[TASK] Remove adodb diff 16/46816/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 Feb 2016 19:58:33 +0000 (20:58 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 22 Feb 2016 20:07:46 +0000 (21:07 +0100)
There is a list of patches we applied to adodb manually in
typo3/sysext/adodb/Documentation/Index.rst. This, together
with 'git log' should be enough in case adodb is updated.
The diff file is pain to maintain and also does not
contain all changes that were done to adodb.

Change-Id: If0525ce90b637541d659569f697377f011b8ad37
Resolves: #73607
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/46816
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/adodb/Documentation/typo3-adodb.diff [deleted file]

diff --git a/typo3/sysext/adodb/Documentation/typo3-adodb.diff b/typo3/sysext/adodb/Documentation/typo3-adodb.diff
deleted file mode 100644 (file)
index 88b0726..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-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/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.php
-index b10d555..21cfc69 100644
---- a/drivers/adodb-mssqlnative.inc.php
-+++ b/drivers/adodb-mssqlnative.inc.php
-@@ -209,10 +209,10 @@ class ADODB_mssqlnative extends ADOConnection {
-               switch($this->mssql_version){
-               case 9:
-               case 10:
--                      return $this->GenID2008();
-+                      return $this->GenID2008($seq, $start);
-                       break;
-               case 11:
--                      return $this->GenID2012();
-+                      return $this->GenID2012($seq, $start);
-                       break;
-               }
-       }
-@@ -225,10 +225,10 @@ class ADODB_mssqlnative extends ADOConnection {
-               switch($this->mssql_version){
-               case 9:
-               case 10:
--                      return $this->CreateSequence2008();
-+                      return $this->CreateSequence2008($seq, $start);
-                       break;
-               case 11:
--                      return $this->CreateSequence2012();
-+                      return $this->CreateSequence2012($seq, $start);
-                       break;
-               }
-@@ -287,7 +287,7 @@ class ADODB_mssqlnative extends ADOConnection {
-               }
-               $num = $this->GetOne("select id from $seq");
-               sqlsrv_commit($this->_connectionID);
--              return true;
-+              return $num;
-       }
-       /**
-        * Only available to Server 2012 and up
-
-@@ -311,7 +311,7 @@ class ADODB_mssqlnative extends ADOConnection {
-               }
-               if (!is_array($this->sequences)
-               || is_array($this->sequences) && !in_array($seq,$this->sequences)){
--                      $this->CreateSequence2012($seq='adodbseq',$start=1);
-+                      $this->CreateSequence2012($seq, $start);
-               }
-               $num = $this->GetOne("SELECT NEXT VALUE FOR $seq");
-
-@@ -459,7 +459,7 @@ class ADODB_mssqlnative extends ADOConnection {
-                               $this->_errorMsg .= "Message: ".$arrError[ 'message']."\n";
-                       }
-               } else {
--                      $this->_errorMsg = "No errors found";
-+                      $this->_errorMsg = '';
-               }
-               return $this->_errorMsg;
-       }
-
-@@ -476,10 +476,26 @@ class ADODB_mssqlnative extends ADOConnection {
-       function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
-       {
-               if (!function_exists('sqlsrv_connect')) return null;
-+              // Port is always given as part of $argHostname but
-+              // 1) should only be set if using an IP/hostname and not a named instance
-+              // 2) must use a comma instead of a colon
-+              list ($hostname, $port) = explode(':', $argHostname, 2);
-+              if (strpos($hostname, '\\') === false) {
-+                      $argHostname = $hostname . ',' . $port;
-+              } else {
-+                      $argHostname = $hostname;
-+              }
-               $connectionInfo = $this->connectionInfo;
--              $connectionInfo["Database"]=$argDatabasename;
--              $connectionInfo["UID"]=$argUsername;
--              $connectionInfo["PWD"]=$argPassword;
-+              $connectionInfo['Database'] = $argDatabasename;
-+              if (!empty($argUsername)) {
-+                      $connectionInfo['UID'] = $argUsername;
-+              }
-+              if (!empty($argPassword)) {
-+                      $connectionInfo['PWD'] = $argPassword;
-+              }
-+              if (!empty($this->charSet)) {
-+                      $connectionInfo['CharacterSet'] = $this->charSet;
-+              }
-               if ($this->debug) error_log("<hr>connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
-               //if ($this->debug) error_log("<hr>_connectionID before: ".serialize($this->_connectionID));
-               if(!($this->_connectionID = sqlsrv_connect($argHostname,$connectionInfo))) {
-
-diff --git a/adodb-datadict.inc.php b/adodb-datadict.inc.php
-index b8b881e..f2b17f3 100644
---- a/adodb-datadict.inc.php
-+++ b/adodb-datadict.inc.php
-@@ -178,6 +178,8 @@ class ADODB_DataDict {
-       var $autoIncrement = false;
-       var $dataProvider;
-       var $invalidResizeTypes4 = array('CLOB','BLOB','TEXT','DATE','TIME'); // for changetablesql
-+      var $blobNotNull = false; // dbms supports NOT NULL for BLOB/TEXT columns
-+      var $blobDefaults = false; // dbms supports defaults for BLOB/TEXT columns
-       var $blobSize = 100;    /// any varchar/char field this size or greater is treated as a blob
-                                                       /// in other words, we use a text area for editting.
-@@ -717,12 +719,12 @@ class ADODB_DataDict {
-                       $ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec);
--                      if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls
-+                      if (($ty == 'X' || $ty == 'X2' || $ty == 'B') && $this->blobNotNull !== true) $fnotnull = false; // some blob types do not accept nulls
-                       if ($fprimary) $pkey[] = $fname;
-                       // some databases do not allow blobs to have defaults
--                      if ($ty == 'X') $fdefault = false;
-+                      if ($ty == 'X' && $this->blobDefaults !== true) $fdefault = false;
-                       // build list of indexes
-                       if ($findex != '') {
-diff --git a/datadict/datadict-mysql.inc.php b/datadict/datadict-mysql.inc.php
-index 773aa0c..701fa66 100644
---- a/datadict/datadict-mysql.inc.php
-+++ b/datadict/datadict-mysql.inc.php
-@@ -21,6 +21,7 @@ class ADODB2_mysql extends ADODB_DataDict {
-       var $dropIndex = 'DROP INDEX %s ON %s';
-       var $renameColumn = 'ALTER TABLE %s CHANGE COLUMN %s %s %s';    // needs column-definition!
-+      var $blobNotNull = true;
-       function MetaType($t,$len=-1,$fieldobj=false)
-       {
-diff --git a/datadict/datadict-postgres.inc.php b/datadict/datadict-postgres.inc.php
-index 965314d..3556825 100644
---- a/datadict/datadict-postgres.inc.php
-+++ b/datadict/datadict-postgres.inc.php
-@@ -22,6 +22,8 @@ class ADODB2_postgres extends ADODB_DataDict {
-       var $quote = '"';
-       var $renameTable = 'ALTER TABLE %s RENAME TO %s'; // at least since 7.1
-       var $dropTable = 'DROP TABLE %s CASCADE';
-+      var $blobNotNull = true;
-+      var $blobDefaults = true;
-       function MetaType($t,$len=-1,$fieldobj=false)
-       {
-diff --git a/datadict/datadict-oci8.inc.php b/datadict/datadict-oci8.inc.php
-index e7b4c2b..3453d4c 100644
---- a/datadict/datadict-oci8.inc.php
-+++ b/datadict/datadict-oci8.inc.php
-@@ -196,23 +196,28 @@ end;
-       {
-               if (!$this->seqField) return array();
-
-+              $sequenceTriggerTableName = trim($tabname, $this->connection->nameQuote);
-               if ($this->schema) {
--                      $t = strpos($tabname,'.');
--                      if ($t !== false) $tab = substr($tabname,$t+1);
--                      else $tab = $tabname;
--                      $seqname = $this->schema.'.'.$this->seqPrefix.$tab;
--                      $trigname = $this->schema.'.'.$this->trigPrefix.$this->seqPrefix.$tab;
-+                      $t = strpos($tabname, '.');
-+                      if ($t !== FALSE) {
-+                              $tab = substr($sequenceTriggerTableName, $t + 1);
-+                      } else {
-+                              $tab = $sequenceTriggerTableName;
-+                      }
-+                      $seqname = $this->schema . '.' . $this->seqPrefix . $tab;
-+                      $trigname = $this->schema . '.' . $this->trigPrefix . $tab;
-               } else {
--                      $seqname = $this->seqPrefix.$tabname;
--                      $trigname = $this->trigPrefix.$seqname;
-+                      $seqname = $this->seqPrefix . $sequenceTriggerTableName;
-+                      $trigname = $this->trigPrefix . $sequenceTriggerTableName;
-               }
-
-               if (strlen($seqname) > 30) {
--                      $seqname = $this->seqPrefix.uniqid('');
--              } // end if
-+                      $seqname = $this->seqPrefix . uniqid('');
-+              }
-               if (strlen($trigname) > 30) {
--                      $trigname = $this->trigPrefix.uniqid('');
--              } // end if
-+                      $trigname = $this->trigPrefix . uniqid('');
-+              }
-
-               if (isset($tableoptions['REPLACE'])) $sql[] = "DROP SEQUENCE $seqname";
-               $seqCache = '';
-diff --git a/drivers/adodb-sqlite.inc.php b/drivers/adodb-sqlite.inc.php
-index e7cf353..286f39c 100644
---- a/drivers/adodb-sqlite.inc.php
-+++ b/drivers/adodb-sqlite.inc.php
-@@ -262,7 +262,7 @@ class ADODB_sqlite extends ADOConnection {
-               return @sqlite_close($this->_connectionID);
-       }
--      function MetaIndexes($table, $primary = FALSE, $owner=false, $owner = false)
-+      function MetaIndexes($table, $primary = FALSE, $owner=false)
-       {
-               $false = false;
-               // save old fetch mode
-diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php
-index af83517..f9f667c 100644
---- a/drivers/adodb-sqlite3.inc.php
-+++ b/drivers/adodb-sqlite3.inc.php
-@@ -282,7 +282,7 @@ class ADODB_sqlite3 extends ADOConnection {
-               return $this->_connectionID->close();
-       }
--      function MetaIndexes($table, $primary = FALSE, $owner=false, $owner = false)
-+      function MetaIndexes($table, $primary = FALSE, $owner=false)
-       {
-               $false = false;
-               // save old fetch mode