diff --git a/typo3/sysext/adodb/Documentation/Index.rst b/typo3/sysext/adodb/Documentation/Index.rst index 8548a99d06fe25132cd65cacc7df0f0ef4cdc4aa..ae7b4c1ec10dfd750def7589c16d9dc82f5b628a 100644 --- a/typo3/sysext/adodb/Documentation/Index.rst +++ b/typo3/sysext/adodb/Documentation/Index.rst @@ -12,7 +12,7 @@ The currently used ADOdb version is 5.19 [1]_. Our changes =========== -This is a list of changes we made in ADOdb and may must re-applied if EXT:adodb is +This is a list of changes we made in ADOdb that must re-applied if EXT:adodb is updated to upstream. - ADOdb: Invalid override method signature (48034_) (Solved in 5.20-dev [2]_) @@ -22,8 +22,10 @@ updated to upstream. - ADOdb: mssqlnative driver fails to create sequences (66678_) - ADOdb: mssqlnative driver is not properly initialized (66830_) - ADOdb: mssqlnative driver does not properly define the port (63070_) +- ADOdb: Allow setting NOT NULL/DEFAULT on blob and text columns (67442_) (Upstream pull request: [3]_) .. [2] https://github.com/ADOdb/ADOdb/commit/85f05a98974ea85ecae943faf230a27afdbaa746 +.. [3] https://github.com/ADOdb/ADOdb/pull/118 .. _48034: https://forge.typo3.org/issues/48034 .. _61738: https://forge.typo3.org/issues/61738 .. _63659: https://forge.typo3.org/issues/63659 @@ -31,6 +33,7 @@ updated to upstream. .. _66678: https://forge.typo3.org/issues/66678 .. _66830: https://forge.typo3.org/issues/66830 .. _63070: https://forge.typo3.org/issues/63070 +.. _67442: https://forge.typo3.org/issues/67442 Diff diff --git a/typo3/sysext/adodb/Documentation/typo3-adodb.diff b/typo3/sysext/adodb/Documentation/typo3-adodb.diff index 520c47a510ae4fc0863f20c2c42acc601c907b5f..aedda146297601f90f6641b1fc606c4a7b4f63bc 100644 --- a/typo3/sysext/adodb/Documentation/typo3-adodb.diff +++ b/typo3/sysext/adodb/Documentation/typo3-adodb.diff @@ -297,3 +297,56 @@ index b10d555..21cfc69 100644 //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/typo3/sysext/adodb/adodb/adodb-datadict.inc.php b/typo3/sysext/adodb/adodb/adodb-datadict.inc.php index b8b881e9de6c1c3b71545711cfe8670f62637f6a..f2b17f3dcea44d18085ac2932e1df8427c4e577d 100644 --- a/typo3/sysext/adodb/adodb/adodb-datadict.inc.php +++ b/typo3/sysext/adodb/adodb/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/typo3/sysext/adodb/adodb/datadict/datadict-mysql.inc.php b/typo3/sysext/adodb/adodb/datadict/datadict-mysql.inc.php index 773aa0c79e183531ab57cad149b6a7803c9f93a0..701fa66030204cec3c60d7f1f2a7e4f366639755 100644 --- a/typo3/sysext/adodb/adodb/datadict/datadict-mysql.inc.php +++ b/typo3/sysext/adodb/adodb/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/typo3/sysext/adodb/adodb/datadict/datadict-postgres.inc.php b/typo3/sysext/adodb/adodb/datadict/datadict-postgres.inc.php index 965314dbc4422ce9d21a46ff32c04590a8d7a3fd..3556825184cf86833aed3debafc120ba07ca211f 100644 --- a/typo3/sysext/adodb/adodb/datadict/datadict-postgres.inc.php +++ b/typo3/sysext/adodb/adodb/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) {