cvs: pear /MDB2_Schema/MDB2/Schema Parser.php /MDB2_Schema/MDB2/Schema/Reserved mysql.php
| From: | Lukas Smith | Date: | Tue, 07 Feb 2006 16:12:07 +0000 |
| Subject: | cvs: pear /MDB2_Schema/MDB2/Schema Parser.php /MDB2_Schema/MDB2/Schema/Reserved mysql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38035@lists.php.net to get a copy of this message | ||
lsmith Tue Feb 7 16:12:07 2006 UTC
Added files:
/pear/MDB2_Schema/MDB2/Schema/Reserved mysql.php
Modified files:
/pear/MDB2_Schema/MDB2/Schema Parser.php
Log:
- expanded reserved word handling
http://cvs.php.net/viewcvs.cgi/pear/MDB2_Schema/MDB2/Schema/Parser.php?r1=1.25&r2=1.26&diff_format=u Index: pear/MDB2_Schema/MDB2/Schema/Parser.php diff -u pear/MDB2_Schema/MDB2/Schema/Parser.php:1.25 pear/MDB2_Schema/MDB2/Schema/Parser.php:1.26 --- pear/MDB2_Schema/MDB2/Schema/Parser.php:1.25 Wed Jan 4 20:10:35 2006 +++ pear/MDB2_Schema/MDB2/Schema/Parser.php Tue Feb 7 16:12:07 2006 @@ -42,11 +42,15 @@ // | Author: Christian Dickmann <dickmann@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Parser.php,v 1.25 2006/01/04 20:10:35 lsmith Exp $ +// $Id: Parser.php,v 1.26 2006/02/07 16:12:07 lsmith Exp $ // require_once 'XML/Parser.php'; +if (!array_key_exists('_MDB2_Schema_Reserved', $GLOBALS)) { + $GLOBALS['_MDB2_Schema_Reserved'] = array(); +} + /** * Parses an XML schema file * @@ -75,23 +79,6 @@ var $seq = array(); var $seq_name = ''; var $error; - var $invalid_names = array( - 'user' => array(), - 'is' => array(), - 'file' => array( - 'oci' => array(), - 'oracle' => array() - ), - 'notify' => array( - 'pgsql' => array() - ), - 'restrict' => array( - 'mysql' => array() - ), - 'password' => array( - 'ibase' => array() - ) - ); var $fail_on_invalid_names = true; var $structure = false; @@ -99,7 +86,14 @@ { parent::XML_Parser(); $this->variables = $variables; - $this->fail_on_invalid_names = $fail_on_invalid_names; + if (is_array($fail_on_invalid_names)) { + $this->fail_on_invalid_names + = array_intersect($fail_on_invalid_names, array_keys($GLOBALS['_MDB2_Schema_Reserved'])); + } elseif ($this->fail_on_invalid_names === true) { + $this->fail_on_invalid_names = array_keys($GLOBALS['_MDB2_Schema_Reserved']); + } else { + $this->fail_on_invalid_names = false; + } $this->structure = $structure; } @@ -184,18 +178,26 @@ /* Table definition */ case 'database-table': - if (!array_key_exists('was', $this->table)) { - $this->table['was'] = $this->table_name; - } - if (!$this->table_name) { - $this->raiseError('tables need names', null, $xp); + $this->raiseError('a table has to have a name', null, $xp); + } elseif ($this->fail_on_invalid_names) { + $name = strtoupper($this->table_name); + foreach ($this->fail_on_invalid_names as $rdbms) { + if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) { + $this->raiseError('table name "'.$this->table_name.'" is a reserved word in: '.$rdbms, null, $xp); + break; + } + } } if (isset($this->database_definition['tables'][$this->table_name])) { $this->raiseError('table "'.$this->table_name.'" already exists', null, $xp); } + if (!array_key_exists('was', $this->table)) { + $this->table['was'] = $this->table_name; + } + $autoinc = $primary = false; if (!array_key_exists('fields', $this->table)) { $this->raiseError('tables need one or more fields', null, $xp); @@ -266,9 +268,15 @@ if (isset($this->table['fields'][$this->field_name])) { $this->raiseError('field "'.$this->field_name.'" already exists', null, $xp); } - /* Invalidname check */ - if ($this->fail_on_invalid_names && isset($this->invalid_names[$this->field_name])) { - $this->raiseError('fieldname "'.$this->field_name.'" not allowed', null, $xp); + + if ($this->fail_on_invalid_names) { + $name = strtoupper($this->field_name); + foreach ($this->fail_on_invalid_names as $rdbms) { + if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) { + $this->raiseError('field name "'.$this->field_name.'" is a reserved word in: '.$rdbms, null, $xp); + break; + } + } } /* Type check */ switch ($this->field['type']) { @@ -339,7 +347,7 @@ /* Index declaration */ case 'database-table-declaration-index': if (!$this->index_name) { - $this->raiseError('an index needs a name', null, $xp); + $this->raiseError('an index has to have a name', null, $xp); } if (isset($this->table['indexes'][$this->index_name])) { $this->raiseError('index "'.$this->index_name.'" already exists', null, $xp); @@ -378,7 +386,16 @@ case 'database-sequence': if (!$this->seq_name) { $this->raiseError('a sequence has to have a name', null, $xp); + } elseif ($this->fail_on_invalid_names) { + $name = strtoupper($this->seq_name); + foreach ($this->fail_on_invalid_names as $rdbms) { + if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) { + $this->raiseError('sequence name "'.$this->seq_name.'" is a reserved word in: '.$rdbms, null, $xp); + break; + } + } } + if (isset($this->database_definition['sequences'][$this->seq_name])) { $this->raiseError('sequence "'.$this->seq_name.'" already exists', null, $xp); } @@ -400,6 +417,18 @@ /* End of File */ case 'database': + if (!isset($this->database_definition['name']) || !$this->database_definition['name']) { + $this->raiseError('a database has to have a name', null, $xp); + } elseif ($this->fail_on_invalid_names) { + $name = strtoupper($this->database_definition['name']); + foreach ($this->fail_on_invalid_names as $rdbms) { + if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) { + $this->raiseError('database name "'.$this->database_definition['name'].'" is a reserved word in: '.$rdbms, null, $xp); + break; + } + } + } + if (isset($this->database_definition['create']) && !$this->isBoolean($this->database_definition['create']) ) { @@ -410,11 +439,7 @@ ) { $this->raiseError('field "overwrite" has to be a boolean value', null, $xp); } - if (!isset($this->database_definition['name']) - || !$this->database_definition['name'] - ) { - $this->raiseError('database needs a name', null, $xp); - } + if (isset($this->database_definition['sequences'])) { foreach ($this->database_definition['sequences'] as $seq_name => $seq) { if (array_key_exists('on', $seq) http://cvs.php.net/viewcvs.cgi/pear/MDB2_Schema/MDB2/Schema/Reserved/mysql.php?view=markup&rev=1.1 Index: pear/MDB2_Schema/MDB2/Schema/Reserved/mysql.php +++ pear/MDB2_Schema/MDB2/Schema/Reserved/mysql.php <?php // {{{ Disclaimer, Licence, copyrights // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ // | Copyright (c) 1998-2004 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ // | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB | // | API as well as database abstraction for PHP applications. | // | This LICENSE is in the BSD license style. | // | | // | Redistribution and use in source and binary forms, with or without | // | modification, are permitted provided that the following conditions | // | are met: | // | | // | Redistributions of source code must retain the above copyright | // | notice, this list of conditions and the following disclaimer. | // | | // | Redistributions in binary form must reproduce the above copyright | // | notice, this list of conditions and the following disclaimer in the | // | documentation and/or other materials provided with the distribution. | // | | // | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, | // | Lukas Smith nor the names of his contributors may be used to endorse | // | or promote products derived from this software without specific prior| // | written permission. | // | | // | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | // | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | // | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | // | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | // | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | // | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | // | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS| // | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | // | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | // | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY| // | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | // | POSSIBILITY OF SUCH DAMAGE. | // +----------------------------------------------------------------------+ // | Author: David Coallier <davidc@php.net> | // +----------------------------------------------------------------------+ // // $Id: mysql.php,v 1.1 2006/02/07 16:12:07 lsmith Exp $ /** * Has a list of reserved words of mysql * * @package MDB2_Schema * @category Database * @access protected * @author David Coalier <davidc@php.net> */ $GLOBALS['_MDB2_Schema_Reserved']['mysql'] = array( 'ADD', 'ALL', 'ALTER', 'ANALYZE', 'AND', 'AS', 'ASC', 'ASENSITIVE', 'BEFORE', 'BETWEEN', 'BIGINT', 'BINARY', 'BLOB', 'BOTH', 'BY', 'CALL', 'CASCADE', 'CASE', 'CHANGE', 'CHAR', 'CHARACTER', 'CHECK', 'COLLATE', 'COLUMN', 'CONDITION', 'CONNECTION', 'CONSTRAINT', 'CONTINUE', 'CONVERT', 'CREATE', 'CROSS', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'CURSOR', 'DATABASE', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DEC', 'DECIMAL', 'DECLARE', 'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DETERMINISTIC', 'DISTINCT', 'DISTINCTROW', 'DIV', 'DOUBLE', 'DROP', 'DUAL', 'EACH', 'ELSE', 'ELSEIF', 'ENCLOSED', 'ESCAPED', 'EXISTS', 'EXIT', 'EXPLAIN', 'FALSE', 'FETCH', 'FLOAT', 'FLOAT4', 'FLOAT8', 'FOR', 'FORCE', 'FOREIGN', 'FROM', 'FULLTEXT', 'GOTO', 'GRANT', 'GROUP', 'HAVING', 'HIGH_PRIORITY', 'HOUR_MICROSECOND', 'HOUR_MINUTE', 'HOUR_SECOND', 'IF', 'IGNORE', 'IN', 'INDEX', 'INFILE', 'INNER', 'INOUT', 'INSENSITIVE', 'INSERT', 'INT', 'INT1', 'INT2', 'INT3', 'INT4', 'INT8', 'INTEGER', 'INTERVAL', 'INTO', 'IS', 'ITERATE', 'JOIN', 'KEY', 'KEYS', 'KILL', 'LABEL', 'LEADING', 'LEAVE', 'LEFT', 'LIKE', 'LIMIT', 'LINES', 'LOAD', 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCK', 'LONG', 'LONGBLOB', 'LONGTEXT', 'LOOP', 'LOW_PRIORITY', 'MATCH', 'MEDIUMBLOB', 'MEDIUMINT', 'MEDIUMTEXT', 'MIDDLEINT', 'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'MOD', 'MODIFIES', 'NATURAL', 'NOT', 'NO_WRITE_TO_BINLOG', 'NULL', 'NUMERIC', 'ON', 'OPTIMIZE', 'OPTION', 'OPTIONALLY', 'OR', 'ORDER', 'OUT', 'OUTER', 'OUTFILE', 'PRECISION', 'PRIMARY', 'PROCEDURE', 'PURGE', 'RAID0', 'READ', 'READS', 'REAL', 'REFERENCES', 'REGEXP', 'RELEASE', 'RENAME', 'REPEAT', 'REPLACE', 'REQUIRE', 'RESTRICT', 'RETURN', 'REVOKE', 'RIGHT', 'RLIKE', 'SCHEMA', 'SCHEMAS', 'SECOND_MICROSECOND', 'SELECT', 'SENSITIVE', 'SEPARATOR', 'SET', 'SHOW', 'SMALLINT', 'SONAME', 'SPATIAL', 'SPECIFIC', 'SQL', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'SQL_BIG_RESULT', 'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'TABLE', 'TERMINATED', 'THEN', 'TINYBLOB', 'TINYINT', 'TINYTEXT', 'TO', 'TRAILING', 'TRIGGER', 'TRUE', 'UNDO', 'UNION', 'UNIQUE', 'UNLOCK', 'UNSIGNED', 'UPDATE', 'USAGE', 'USE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'VALUES', 'VARBINARY', 'VARCHAR', 'VARCHARACTER', 'VARYING', 'WHEN', 'WHERE', 'WHILE', 'WITH', 'WRITE', 'X509', 'XOR', 'YEAR_MONTH', 'ZEROFILL', );
http://cvs.php.net/viewcvs.cgi/pear/MDB2_Schema/MDB2/Schema/Parser.php?r1=1.25&r2=1.26&diff_format=u Index: pear/MDB2_Schema/MDB2/Schema/Parser.php diff -u pear/MDB2_Schema/MDB2/Schema/Parser.php:1.25 pear/MDB2_Schema/MDB2/Schema/Parser.php:1.26 --- pear/MDB2_Schema/MDB2/Schema/Parser.php:1.25 Wed Jan 4 20:10:35 2006 +++ pear/MDB2_Schema/MDB2/Schema/Parser.php Tue Feb 7 16:12:07 2006 @@ -42,11 +42,15 @@ // | Author: Christian Dickmann <dickmann@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Parser.php,v 1.25 2006/01/04 20:10:35 lsmith Exp $ +// $Id: Parser.php,v 1.26 2006/02/07 16:12:07 lsmith Exp $ // require_once 'XML/Parser.php'; +if (!array_key_exists('_MDB2_Schema_Reserved', $GLOBALS)) { + $GLOBALS['_MDB2_Schema_Reserved'] = array(); +} + /** * Parses an XML schema file * @@ -75,23 +79,6 @@ var $seq = array(); var $seq_name = ''; var $error; - var $invalid_names = array( - 'user' => array(), - 'is' => array(), - 'file' => array( - 'oci' => array(), - 'oracle' => array() - ), - 'notify' => array( - 'pgsql' => array() - ), - 'restrict' => array( - 'mysql' => array() - ), - 'password' => array( - 'ibase' => array() - ) - ); var $fail_on_invalid_names = true; var $structure = false; @@ -99,7 +86,14 @@ { parent::XML_Parser(); $this->variables = $variables; - $this->fail_on_invalid_names = $fail_on_invalid_names; + if (is_array($fail_on_invalid_names)) { + $this->fail_on_invalid_names + = array_intersect($fail_on_invalid_names, array_keys($GLOBALS['_MDB2_Schema_Reserved'])); + } elseif ($this->fail_on_invalid_names === true) { + $this->fail_on_invalid_names = array_keys($GLOBALS['_MDB2_Schema_Reserved']); + } else { + $this->fail_on_invalid_names = false; + } $this->structure = $structure; } @@ -184,18 +178,26 @@ /* Table definition */ case 'database-table': - if (!array_key_exists('was', $this->table)) { - $this->table['was'] = $this->table_name; - } - if (!$this->table_name) { - $this->raiseError('tables need names', null, $xp); + $this->raiseError('a table has to have a name', null, $xp); + } elseif ($this->fail_on_invalid_names) { + $name = strtoupper($this->table_name); + foreach ($this->fail_on_invalid_names as $rdbms) { + if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) { + $this->raiseError('table name "'.$this->table_name.'" is a reserved word in: '.$rdbms, null, $xp); + break; + } + } } if (isset($this->database_definition['tables'][$this->table_name])) { $this->raiseError('table "'.$this->table_name.'" already exists', null, $xp); } + if (!array_key_exists('was', $this->table)) { + $this->table['was'] = $this->table_name; + } + $autoinc = $primary = false; if (!array_key_exists('fields', $this->table)) { $this->raiseError('tables need one or more fields', null, $xp); @@ -266,9 +268,15 @@ if (isset($this->table['fields'][$this->field_name])) { $this->raiseError('field "'.$this->field_name.'" already exists', null, $xp); } - /* Invalidname check */ - if ($this->fail_on_invalid_names && isset($this->invalid_names[$this->field_name])) { - $this->raiseError('fieldname "'.$this->field_name.'" not allowed', null, $xp); + + if ($this->fail_on_invalid_names) { + $name = strtoupper($this->field_name); + foreach ($this->fail_on_invalid_names as $rdbms) { + if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) { + $this->raiseError('field name "'.$this->field_name.'" is a reserved word in: '.$rdbms, null, $xp); + break; + } + } } /* Type check */ switch ($this->field['type']) { @@ -339,7 +347,7 @@ /* Index declaration */ case 'database-table-declaration-index': if (!$this->index_name) { - $this->raiseError('an index needs a name', null, $xp); + $this->raiseError('an index has to have a name', null, $xp); } if (isset($this->table['indexes'][$this->index_name])) { $this->raiseError('index "'.$this->index_name.'" already exists', null, $xp); @@ -378,7 +386,16 @@ case 'database-sequence': if (!$this->seq_name) { $this->raiseError('a sequence has to have a name', null, $xp); + } elseif ($this->fail_on_invalid_names) { + $name = strtoupper($this->seq_name); + foreach ($this->fail_on_invalid_names as $rdbms) { + if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) { + $this->raiseError('sequence name "'.$this->seq_name.'" is a reserved word in: '.$rdbms, null, $xp); + break; + } + } } + if (isset($this->database_definition['sequences'][$this->seq_name])) { $this->raiseError('sequence "'.$this->seq_name.'" already exists', null, $xp); } @@ -400,6 +417,18 @@ /* End of File */ case 'database': + if (!isset($this->database_definition['name']) || !$this->database_definition['name']) { + $this->raiseError('a database has to have a name', null, $xp); + } elseif ($this->fail_on_invalid_names) { + $name = strtoupper($this->database_definition['name']); + foreach ($this->fail_on_invalid_names as $rdbms) { + if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) { + $this->raiseError('database name "'.$this->database_definition['name'].'" is a reserved word in: '.$rdbms, null, $xp); + break; + } + } + } + if (isset($this->database_definition['create']) && !$this->isBoolean($this->database_definition['create']) ) { @@ -410,11 +439,7 @@ ) { $this->raiseError('field "overwrite" has to be a boolean value', null, $xp); } - if (!isset($this->database_definition['name']) - || !$this->database_definition['name'] - ) { - $this->raiseError('database needs a name', null, $xp); - } + if (isset($this->database_definition['sequences'])) { foreach ($this->database_definition['sequences'] as $seq_name => $seq) { if (array_key_exists('on', $seq) http://cvs.php.net/viewcvs.cgi/pear/MDB2_Schema/MDB2/Schema/Reserved/mysql.php?view=markup&rev=1.1 Index: pear/MDB2_Schema/MDB2/Schema/Reserved/mysql.php +++ pear/MDB2_Schema/MDB2/Schema/Reserved/mysql.php <?php // {{{ Disclaimer, Licence, copyrights // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ // | Copyright (c) 1998-2004 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ // | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB | // | API as well as database abstraction for PHP applications. | // | This LICENSE is in the BSD license style. | // | | // | Redistribution and use in source and binary forms, with or without | // | modification, are permitted provided that the following conditions | // | are met: | // | | // | Redistributions of source code must retain the above copyright | // | notice, this list of conditions and the following disclaimer. | // | | // | Redistributions in binary form must reproduce the above copyright | // | notice, this list of conditions and the following disclaimer in the | // | documentation and/or other materials provided with the distribution. | // | | // | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, | // | Lukas Smith nor the names of his contributors may be used to endorse | // | or promote products derived from this software without specific prior| // | written permission. | // | | // | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | // | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | // | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | // | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | // | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | // | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | // | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS| // | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | // | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | // | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY| // | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | // | POSSIBILITY OF SUCH DAMAGE. | // +----------------------------------------------------------------------+ // | Author: David Coallier <davidc@php.net> | // +----------------------------------------------------------------------+ // // $Id: mysql.php,v 1.1 2006/02/07 16:12:07 lsmith Exp $ /** * Has a list of reserved words of mysql * * @package MDB2_Schema * @category Database * @access protected * @author David Coalier <davidc@php.net> */ $GLOBALS['_MDB2_Schema_Reserved']['mysql'] = array( 'ADD', 'ALL', 'ALTER', 'ANALYZE', 'AND', 'AS', 'ASC', 'ASENSITIVE', 'BEFORE', 'BETWEEN', 'BIGINT', 'BINARY', 'BLOB', 'BOTH', 'BY', 'CALL', 'CASCADE', 'CASE', 'CHANGE', 'CHAR', 'CHARACTER', 'CHECK', 'COLLATE', 'COLUMN', 'CONDITION', 'CONNECTION', 'CONSTRAINT', 'CONTINUE', 'CONVERT', 'CREATE', 'CROSS', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'CURSOR', 'DATABASE', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DEC', 'DECIMAL', 'DECLARE', 'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DETERMINISTIC', 'DISTINCT', 'DISTINCTROW', 'DIV', 'DOUBLE', 'DROP', 'DUAL', 'EACH', 'ELSE', 'ELSEIF', 'ENCLOSED', 'ESCAPED', 'EXISTS', 'EXIT', 'EXPLAIN', 'FALSE', 'FETCH', 'FLOAT', 'FLOAT4', 'FLOAT8', 'FOR', 'FORCE', 'FOREIGN', 'FROM', 'FULLTEXT', 'GOTO', 'GRANT', 'GROUP', 'HAVING', 'HIGH_PRIORITY', 'HOUR_MICROSECOND', 'HOUR_MINUTE', 'HOUR_SECOND', 'IF', 'IGNORE', 'IN', 'INDEX', 'INFILE', 'INNER', 'INOUT', 'INSENSITIVE', 'INSERT', 'INT', 'INT1', 'INT2', 'INT3', 'INT4', 'INT8', 'INTEGER', 'INTERVAL', 'INTO', 'IS', 'ITERATE', 'JOIN', 'KEY', 'KEYS', 'KILL', 'LABEL', 'LEADING', 'LEAVE', 'LEFT', 'LIKE', 'LIMIT', 'LINES', 'LOAD', 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCK', 'LONG', 'LONGBLOB', 'LONGTEXT', 'LOOP', 'LOW_PRIORITY', 'MATCH', 'MEDIUMBLOB', 'MEDIUMINT', 'MEDIUMTEXT', 'MIDDLEINT', 'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'MOD', 'MODIFIES', 'NATURAL', 'NOT', 'NO_WRITE_TO_BINLOG', 'NULL', 'NUMERIC', 'ON', 'OPTIMIZE', 'OPTION', 'OPTIONALLY', 'OR', 'ORDER', 'OUT', 'OUTER', 'OUTFILE', 'PRECISION', 'PRIMARY', 'PROCEDURE', 'PURGE', 'RAID0', 'READ', 'READS', 'REAL', 'REFERENCES', 'REGEXP', 'RELEASE', 'RENAME', 'REPEAT', 'REPLACE', 'REQUIRE', 'RESTRICT', 'RETURN', 'REVOKE', 'RIGHT', 'RLIKE', 'SCHEMA', 'SCHEMAS', 'SECOND_MICROSECOND', 'SELECT', 'SENSITIVE', 'SEPARATOR', 'SET', 'SHOW', 'SMALLINT', 'SONAME', 'SPATIAL', 'SPECIFIC', 'SQL', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'SQL_BIG_RESULT', 'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'TABLE', 'TERMINATED', 'THEN', 'TINYBLOB', 'TINYINT', 'TINYTEXT', 'TO', 'TRAILING', 'TRIGGER', 'TRUE', 'UNDO', 'UNION', 'UNIQUE', 'UNLOCK', 'UNSIGNED', 'UPDATE', 'USAGE', 'USE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'VALUES', 'VARBINARY', 'VARCHAR', 'VARCHARACTER', 'VARYING', 'WHEN', 'WHERE', 'WHILE', 'WITH', 'WRITE', 'X509', 'XOR', 'YEAR_MONTH', 'ZEROFILL', );