[BUGFIX] EXT:adodb: Table names in ALTER TABLE are broken 55/35155/3
authorAndreas Fernandez <andreas.fernandez@aspedia.de>
Mon, 8 Dec 2014 09:12:18 +0000 (10:12 +0100)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Tue, 13 Jan 2015 14:05:09 +0000 (15:05 +0100)
Updating a table using the Oracle DBMS does not work due to improper
quoting in the oci8 datadict.

Resolves: #63659
Releases: master, 6.2
Change-Id: I831f4affebd161cfd22580506714bc6c7d70f207
Reviewed-on: http://review.typo3.org/35155
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/sysext/adodb/Documentation/Index.rst [new file with mode: 0644]
typo3/sysext/adodb/Documentation/typo3-adodb.diff [new file with mode: 0644]
typo3/sysext/adodb/README.txt [deleted file]
typo3/sysext/adodb/adodb/datadict/datadict-oci8.inc.php

diff --git a/typo3/sysext/adodb/Documentation/Index.rst b/typo3/sysext/adodb/Documentation/Index.rst
new file mode 100644 (file)
index 0000000..35f1977
--- /dev/null
@@ -0,0 +1,32 @@
+=============================================
+Changes made in EXT:adodb missing in upstream
+=============================================
+
+Now in use
+==========
+The currently used ADOdb version is 5.19 [1]_.
+
+.. [1] https://github.com/ADOdb/ADOdb/releases/tag/v5.19
+
+
+Our changes
+===========
+
+This is a list of changes we made in ADOdb and may must re-applied if EXT:adodb is
+updated to upstream.
+
+- ADOdb: Invalid override method signature (48034_) (Solved in 5.20-dev [2]_)
+- ADOdb: Set charset properly (61738_)
+- EXT:adodb: Table names in ALTER TABLE broken (63659_)
+
+.. [2] https://github.com/ADOdb/ADOdb/commit/85f05a98974ea85ecae943faf230a27afdbaa746
+.. _48034: https://forge.typo3.org/issues/48034
+.. _61738: https://forge.typo3.org/issues/61738
+.. _63659: https://forge.typo3.org/issues/63659
+
+
+Diff
+====
+
+You'll find a diff file in EXT:adodb/Documentation/typo3-adodb.diff.
+
diff --git a/typo3/sysext/adodb/Documentation/typo3-adodb.diff b/typo3/sysext/adodb/Documentation/typo3-adodb.diff
new file mode 100644 (file)
index 0000000..b1ad640
--- /dev/null
@@ -0,0 +1,208 @@
+diff --git a/adodb.inc.php b/adodb.inc.php
+index e9011e9..51d6313 100644
+--- a/adodb.inc.php
++++ b/adodb.inc.php
+@@ -2037,7 +2037,8 @@ if (!defined('_ADODB_LAYER')) {
+       function SetCharSet($charset)
+       {
+-              return false;
++              $this->charSet = $charset;
++              return TRUE;
+       }
+       function IfNull( $field, $ifNull )
+diff --git a/datadict/datadict-access.inc.php b/datadict/datadict-access.inc.php
+index 6a0a2cd..cabcab8 100644
+--- a/datadict/datadict-access.inc.php
++++ b/datadict/datadict-access.inc.php
+@@ -77,14 +77,14 @@ class ADODB2_access extends ADODB_DataDict {
+       {
+       }
+-      function AlterColumnSQL($tabname, $flds)
++      function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
+               return array();
+       }
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
+               return array();
+diff --git a/datadict/datadict-db2.inc.php b/datadict/datadict-db2.inc.php
+index 5bbca1d..95a693f 100644
+--- a/datadict/datadict-db2.inc.php
++++ b/datadict/datadict-db2.inc.php
+@@ -58,14 +58,14 @@ class ADODB2_db2 extends ADODB_DataDict {
+               return $suffix;
+       }
+-      function AlterColumnSQL($tabname, $flds)
++      function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
+               return array();
+       }
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
+               return array();
+diff --git a/datadict/datadict-generic.inc.php b/datadict/datadict-generic.inc.php
+index b3736f5..e6336da 100644
+--- a/datadict/datadict-generic.inc.php
++++ b/datadict/datadict-generic.inc.php
+@@ -49,14 +49,14 @@ class ADODB2_generic extends ADODB_DataDict {
+               }
+       }
+-      function AlterColumnSQL($tabname, $flds)
++      function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
+               return array();
+       }
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
+               return array();
+diff --git a/datadict/datadict-ibase.inc.php b/datadict/datadict-ibase.inc.php
+index 13f028e..e08ae3c 100644
+--- a/datadict/datadict-ibase.inc.php
++++ b/datadict/datadict-ibase.inc.php
+@@ -49,14 +49,14 @@ class ADODB2_ibase extends ADODB_DataDict {
+               }
+       }
+-      function AlterColumnSQL($tabname, $flds)
++      function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
+               return array();
+       }
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
+               return array();
+diff --git a/datadict/datadict-informix.inc.php b/datadict/datadict-informix.inc.php
+index 1bc6880..76c7585 100644
+--- a/datadict/datadict-informix.inc.php
++++ b/datadict/datadict-informix.inc.php
+@@ -49,14 +49,14 @@ class ADODB2_informix extends ADODB_DataDict {
+               }
+       }
+-      function AlterColumnSQL($tabname, $flds)
++      function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
+               return array();
+       }
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
+               return array();
+diff --git a/datadict/datadict-mssql.inc.php b/datadict/datadict-mssql.inc.php
+index 6610fc4..3374ebd 100644
+--- a/datadict/datadict-mssql.inc.php
++++ b/datadict/datadict-mssql.inc.php
+@@ -137,7 +137,7 @@ class ADODB2_mssql extends ADODB_DataDict {
+       }
+       */
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               $tabname = $this->TableName ($tabname);
+               if (!is_array($flds))
+diff --git a/datadict/datadict-oci8.inc.php b/datadict/datadict-oci8.inc.php
+index 0f03389..b8bd4cf 100644
+--- a/datadict/datadict-oci8.inc.php
++++ b/datadict/datadict-oci8.inc.php
+@@ -116,6 +116,7 @@ class ADODB2_oci8 extends ADODB_DataDict {
+       function AddColumnSQL($tabname, $flds)
+       {
++              $tabname = $this->TableName ($tabname);
+               $f = array();
+               list($lines,$pkey) = $this->_GenFields($flds);
+               $s = "ALTER TABLE $tabname ADD (";
+@@ -128,8 +129,9 @@ class ADODB2_oci8 extends ADODB_DataDict {
+               return $sql;
+       }
+-      function AlterColumnSQL($tabname, $flds)
++      function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
++              $tabname = $this->TableName ($tabname);
+               $f = array();
+               list($lines,$pkey) = $this->_GenFields($flds);
+               $s = "ALTER TABLE $tabname MODIFY(";
+@@ -141,8 +143,9 @@ class ADODB2_oci8 extends ADODB_DataDict {
+               return $sql;
+       }
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
++              $tabname = $this->TableName ($tabname);
+               if (!is_array($flds)) $flds = explode(',',$flds);
+               foreach ($flds as $k => $v) $flds[$k] = $this->NameQuote($v);
+diff --git a/datadict/datadict-sapdb.inc.php b/datadict/datadict-sapdb.inc.php
+index aaa4820..8241b20 100644
+--- a/datadict/datadict-sapdb.inc.php
++++ b/datadict/datadict-sapdb.inc.php
+@@ -100,7 +100,7 @@ class ADODB2_sapdb extends ADODB_DataDict {
+               return array( 'ALTER TABLE ' . $tabname . ' ADD (' . implode(', ',$lines) . ')' );
+       }
+-      function AlterColumnSQL($tabname, $flds)
++      function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               $tabname = $this->TableName ($tabname);
+               $sql = array();
+@@ -108,7 +108,7 @@ class ADODB2_sapdb extends ADODB_DataDict {
+               return array( 'ALTER TABLE ' . $tabname . ' MODIFY (' . implode(', ',$lines) . ')' );
+       }
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               $tabname = $this->TableName ($tabname);
+               if (!is_array($flds)) $flds = explode(',',$flds);
+diff --git a/datadict/datadict-sqlite.inc.php b/datadict/datadict-sqlite.inc.php
+index 81fb016..5ff76b9 100644
+--- a/datadict/datadict-sqlite.inc.php
++++ b/datadict/datadict-sqlite.inc.php
+@@ -67,13 +67,13 @@ class ADODB2_sqlite extends ADODB_DataDict {
+               return $suffix;
+       }
+-      function AlterColumnSQL($tabname, $flds)
++      function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported natively by SQLite");
+               return array();
+       }
+-      function DropColumnSQL($tabname, $flds)
++      function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
+       {
+               if ($this->debug) ADOConnection::outp("DropColumnSQL not supported natively by SQLite");
+               return array();
diff --git a/typo3/sysext/adodb/README.txt b/typo3/sysext/adodb/README.txt
deleted file mode 100644 (file)
index 5399ce0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-This folder contains the ADOdb library used by DBAL to connect to the
-various DBMS we are supporting with TYPO3.
-
-Latest version may be downloaded: on http://adodb.sourceforge.net/
-
-BEWARE: At least in version 5.19 and below some methods are not properly
-extending their parent's method signature and cause PHP warnings.
-Please apply patch from http://forge.typo3.org/issues/48034 if needed.
-
-The charset is not set properly for every driver, so another patch
-is required: https://forge.typo3.org/issues/61738
-There is also a pull request for this issue so this might be fixed in
-the next release: https://github.com/ADOdb/ADOdb/pull/39
\ No newline at end of file
index e499b87..e7b4c2b 100644 (file)
@@ -116,6 +116,7 @@ class ADODB2_oci8 extends ADODB_DataDict {
 
        function AddColumnSQL($tabname, $flds)
        {
+               $tabname = $this->TableName ($tabname);
                $f = array();
                list($lines,$pkey) = $this->_GenFields($flds);
                $s = "ALTER TABLE $tabname ADD (";
@@ -130,6 +131,7 @@ class ADODB2_oci8 extends ADODB_DataDict {
 
        function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
        {
+               $tabname = $this->TableName ($tabname);
                $f = array();
                list($lines,$pkey) = $this->_GenFields($flds);
                $s = "ALTER TABLE $tabname MODIFY(";
@@ -143,6 +145,7 @@ class ADODB2_oci8 extends ADODB_DataDict {
 
        function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
        {
+               $tabname = $this->TableName ($tabname);
                if (!is_array($flds)) $flds = explode(',',$flds);
                foreach ($flds as $k => $v) $flds[$k] = $this->NameQuote($v);