You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wp-includes/sqlite/class-wp-sqlite-translator.php
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1004,12 +1004,21 @@ private function parse_create_table() {
1004
1004
$this->rewriter->replace_all( array() );
1005
1005
1006
1006
/*
1007
-
* Decide how to parse the current line. We expect either:
1007
+
* Decide how to parse the current line. We ehttps://github.com/WordPress/sqlite-database-integration/blob/eba8ab5a92d95d332cdbcdf008c7328906027cc2/wp-includes/sqlite/class-wp-sqlite-translator.php#L1007xpect either:
1008
1008
*
1009
1009
* Field definition, e.g.:
1010
1010
* `my_field` varchar(255) NOT NULL DEFAULT 'foo'
1011
1011
* Constraint definition, e.g.:
1012
1012
* PRIMARY KEY (`my_field`)
1013
+
*
1014
+
* Lexer does not seem to reliably understand whether the
1015
+
* first token is a field name or a reserved keyword, so
1016
+
* alongside checking for the reserved keyword, we'll also
1017
+
* check whether the second non-whitespace token is a data type.
1018
+
*
1019
+
* By checking for the reserved keyword, we can be sure that
1020
+
* we're not parsing a constraint as a field when the
0 commit comments