diff options
Diffstat (limited to 'adodb-datadict.inc.php')
| -rw-r--r-- | adodb-datadict.inc.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/adodb-datadict.inc.php b/adodb-datadict.inc.php index 1282fbf0..29f2120c 100644 --- a/adodb-datadict.inc.php +++ b/adodb-datadict.inc.php @@ -845,7 +845,7 @@ class ADODB_DataDict { $fdefault = $this->connection->qstr($fdefault); } } - $suffix = $this->_createSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned); + $suffix = $this->_createSuffix($fname, $ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, $pkey); // add index creation if ($widespacing) $fname = str_pad($fname,24); @@ -898,8 +898,22 @@ class ADODB_DataDict { } - // return string must begin with space - function _createSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + /** + * Construct an database specific SQL string of constraints for column. + * + * @param string $fname column name + * @param string & $ftype column type + * @param bool $fnotnull NOT NULL flag + * @param string|bool $fdefault DEFAULT value + * @param bool $fautoinc AUTOINCREMENT flag + * @param string $fconstraint CONSTRAINT value + * @param bool $funsigned UNSIGNED flag + * @param string|bool $fprimary PRIMARY value + * @param array & $pkey array of primary key column names + * + * @return string Combined constraint string, must start with a space + */ + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; |
