13 require_once dirname(__FILE__).
'/DALConverter.inc';
42 protected $name =
'MySQL';
50 protected $dataTypes = array(
52 'varchar' =>
'VARCHAR',
56 'smallint' =>
'SMALLINT',
57 'numeric' =>
'NUMERIC',
60 'double_precision' =>
'DOUBLE PRECISION',
61 'boolean' =>
'VARCHAR(10)',
64 'timestamp' =>
'DATETIME',
65 'time with time zone' =>
'TIME',
90 $this->tableName = $table[
'table'];
93 $sql .=
"\n".$this->convertCreateColumns($table);
94 $sql .=
')TYPE=InnoDB;';
97 if ($indexes !==
'') {
98 $sql .=
"\n".$indexes;
102 $sql .=
"\n".$constraints;
106 if (isset($table[
'SEQUENCES']) === TRUE) {
107 $sql .=
"\n".$this->convertCreateSequences($table[
'SEQUENCES']);
129 if (empty($constraints) === FALSE) {
132 foreach ($convertedCons as $constraint) {
134 if ($incHeader === TRUE) {
138 $sql .=
'ADD '.$constraint;
143 $sql = implode(
";\n", $cons).
";\n";
161 $sql =
'CREATE TABLE '.$sequence.
' (
162 id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)';
181 $sql =
'INSERT INTO '.$seqName[0].
' VALUES(0)';
200 $sql =
'SELECT LAST_INSERT_ID()';
241 $sql = $iso8601_date;
257 $sql =
'DROP TABLE IF EXISTS '.$tableName;
288 $sql =
'CONCAT('.implode(
', ', $args).
')';