MonetDB: reserved SQL keywords
Hi Hannes, FYI, we have a system table sys.keywords with all the reserved SQL keywords. The intention of this table is to have one place (in the server) with all the reserved SQL keywords, such that API implementations (ODBC, JDBC, PHP, Ruby, Python, R, etc) can query that table and construct the list or string. In the default branch I have implemented this already for jdbc/MonetDatabaseMetaData.java method getSQLKeywords(). This should reduce future maintenance of all the places where these reserved SQL keywords are hardcoded. The new keywords can simply be added/ in one place, the keywords table. It is filled in sql/scripts/51_sys_schema_extension.sql Regards, Martin van Dinther On 24-11-15 09:42, Hannes Muehleisen wrote:
Changeset: c0fb9a0d91e3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c0fb9a0d91e3 Modified Files: clients/R/MonetDB.R/R/dbi.R Branch: embedded Log Message:
R Connector: More naughty words
diffs (65 lines):
diff --git a/clients/R/MonetDB.R/R/dbi.R b/clients/R/MonetDB.R/R/dbi.R --- a/clients/R/MonetDB.R/R/dbi.R +++ b/clients/R/MonetDB.R/R/dbi.R @@ -391,24 +391,43 @@ setMethod("dbSendQuery", signature(conn= invisible(new("MonetDBEmbeddedResult", env=env)) })
- -reserved_monetdb_keywords <- c(.SQL92Keywords, -"ADMIN", "AFTER", "AGGREGATE", "ALWAYS", "ASYMMETRIC", "ATOMIC", -"AUTO_INCREMENT", "BEFORE", "BEST", "BIGINT", "BIGSERIAL", "BINARY", -"BLOB", "CALL", "CHAIN", "CLOB", "COMMITTED", "COPY", "CROSS", -"CURRENT_ROLE", "CURRENT_TIME", "CURRENT_USER", "DELIMITERS", -"DO", "EACH", "EFFORT", "ELSEIF", "ENCRYPTED", "EXCLUDE", "FOLLOWING", -"FUNCTION", "GENERATED", "HUGEINT", "IF", "ILIKE", "LIMIT", "LOCALTIME", -"LOCALTIMESTAMP", "LOCKED", "MERGE", "NATURAL", "NEW", "NOCYCLE", -"NOMAXVALUE", "NOMINVALUE", "OFFSET", "OLD", "ON", "OTHERS", -"OVER", "PARTITION", "PRECEDING", "RANGE", "RECORDS", "REFERENCING", -"REMOTE", "RENAME", "REPEATABLE", "REPLICA", "RESTART", "RETURN", -"RETURNS", "SAMPLE", "SAVEPOINT", "SEQUENCE", "SERIAL", "SERIALIZABLE", -"SESSION_USER", "SIMPLE", "SPLIT_PART", "STDIN", "STDOUT", "STREAM", -"SYMMETRIC", "TIES", "TINYINT", "TRIGGER", "UNBOUNDED", "UNCOMMITTED", -"UNENCRYPTED", "WHILE", "XMLAGG", "XMLATTRIBUTES", "XMLCOMMENT", -"XMLCONCAT", "XMLDOCUMENT", "XMLELEMENT", "XMLFOREST", "XMLNAMESPACES", -"XMLPARSE", "XMLPI", "XMLQUERY", "XMLSCHEMA", "XMLTEXT", "XMLVALIDATE") +# found from sql_scan.c and trial/error +reserved_monetdb_keywords <- sort(unique(toupper(c(.SQL92Keywords, +"ADD", "ADMIN", "AFTER", "AGGREGATE", "ALL", "ALTER", "ALWAYS", +"AND", "ANY", "ASC", "ASYMMETRIC", "ATOMIC", "AUTO_INCREMENT", +"BEFORE", "BEGIN", "BEST", "BETWEEN", "BIGINT", "BIGSERIAL", +"BINARY", "BLOB", "BY", "CALL", "CASCADE", "CASE", "CAST", "CHAIN", +"CHAR", "CHARACTER", "CHECK", "CLOB", "COALESCE", "COMMIT", "COMMITTED", +"CONSTRAINT", "CONVERT", "COPY", "CORRESPONDING", "CREATE", "CROSS", +"CURRENT", "CURRENT_DATE", "CURRENT_ROLE", "CURRENT_TIME", "CURRENT_TIMESTAMP", +"CURRENT_USER", "DAY", "DEC", "DECIMAL", "DECLARE", "DEFAULT", +"DELETE", "DELIMITERS", "DESC", "DO", "DOUBLE", "DROP", "EACH", +"EFFORT", "ELSE", "ELSEIF", "ENCRYPTED", "END", "ESCAPE", "EVERY", +"EXCEPT", "EXCLUDE", "EXISTS", "EXTERNAL", "EXTRACT", "FALSE", +"FLOAT", "FOLLOWING", "FOR", "FOREIGN", "FROM", "FULL", "FUNCTION", +"GENERATED", "GLOBAL", "GRANT", "GROUP", "HAVING", "HOUR", "HUGEINT", +"IDENTITY", "IF", "ILIKE", "IN", "INDEX", "INNER", "INSERT", +"INT", "INTEGER", "INTERSECT", "INTO", "IS", "ISOLATION", "JOIN", +"LEFT", "LIKE", "LIMIT", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", +"LOCKED", "MEDIUMINT", "MERGE", "MINUTE", "MONTH", "NATURAL", +"NEW", "NEXT", "NOCYCLE", "NOMAXVALUE", "NOMINVALUE", "NOT", +"NOW", "NULL", "NULLIF", "NUMERIC", "OF", "OFFSET", "OLD", "ON", +"ONLY", "OPTION", "OR", "ORDER", "OTHERS", "OUTER", "OVER", "PARTIAL", +"PARTITION", "POSITION", "PRECEDING", "PRESERVE", "PRIMARY", +"PRIVILEGES", "PROCEDURE", "PUBLIC", "RANGE", "READ", "REAL", +"RECORDS", "REFERENCES", "REFERENCING", "REMOTE", "RENAME", "REPEATABLE", +"REPLICA", "RESTART", "RESTRICT", "RETURN", "RETURNS", "REVOKE", +"RIGHT", "ROLLBACK", "ROWS", "SAMPLE", "SAVEPOINT", "SECOND", +"SELECT", "SEQUENCE", "SERIAL", "SERIALIZABLE", "SESSION_USER", +"SET", "SIMPLE", "SMALLINT", "SOME", "SPLIT_PART", "STDIN", "STDOUT", +"STORAGE", "STREAM", "STRING", "SUBSTRING", "SYMMETRIC", "THEN", +"TIES", "TINYINT", "TO", "TRANSACTION", "TRIGGER", "TRUE", "UNBOUNDED", +"UNCOMMITTED", "UNENCRYPTED", "UNION", "UNIQUE", "UPDATE", "USER", +"USING", "VALUES", "VARCHAR", "VARYING", "VIEW", "WHEN", "WHERE", +"WHILE", "WITH", "WORK", "WRITE", "XMLAGG", "XMLATTRIBUTES", +"XMLCOMMENT", "XMLCONCAT", "XMLDOCUMENT", "XMLELEMENT", "XMLFOREST", +"XMLNAMESPACES", "XMLPARSE", "XMLPI", "XMLQUERY", "XMLSCHEMA", +"XMLTEXT", "XMLVALIDATE", "YEAR"))))
# quoting quoteIfNeeded <- function(conn, x, warn=T, ...) { _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
On 10 Dec 2015, at 18:46, martin van dinther
wrote: FYI, we have a system table sys.keywords with all the reserved SQL keywords.
Hey Martin, thanks for the pointer, did not know that!
The intention of this table is to have one place (in the server) with all the reserved SQL keywords, such that API implementations (ODBC, JDBC, PHP, Ruby, Python, R, etc) can query that table and construct the list or string. In the default branch I have implemented this already for jdbc/MonetDatabaseMetaData.java method getSQLKeywords().
This should reduce future maintenance of all the places where these reserved SQL keywords are hardcoded. The new keywords can simply be added/ in one place, the keywords table. It is filled in sql/scripts/51_sys_schema_extension.sql
I’m also adding all the keywords I found to produce errors through trial/error Hannes
On 24-11-15 09:42, Hannes Muehleisen wrote:
Changeset: c0fb9a0d91e3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c0fb9a0d91e3 Modified Files: clients/R/MonetDB.R/R/dbi.R Branch: embedded Log Message:
R Connector: More naughty words
diffs (65 lines):
diff --git a/clients/R/MonetDB.R/R/dbi.R b/clients/R/MonetDB.R/R/dbi.R --- a/clients/R/MonetDB.R/R/dbi.R +++ b/clients/R/MonetDB.R/R/dbi.R @@ -391,24 +391,43 @@ setMethod("dbSendQuery", signature(conn= invisible(new("MonetDBEmbeddedResult", env=env)) }) - -reserved_monetdb_keywords <- c(.SQL92Keywords, -"ADMIN", "AFTER", "AGGREGATE", "ALWAYS", "ASYMMETRIC", "ATOMIC", -"AUTO_INCREMENT", "BEFORE", "BEST", "BIGINT", "BIGSERIAL", "BINARY", -"BLOB", "CALL", "CHAIN", "CLOB", "COMMITTED", "COPY", "CROSS", -"CURRENT_ROLE", "CURRENT_TIME", "CURRENT_USER", "DELIMITERS", -"DO", "EACH", "EFFORT", "ELSEIF", "ENCRYPTED", "EXCLUDE", "FOLLOWING", -"FUNCTION", "GENERATED", "HUGEINT", "IF", "ILIKE", "LIMIT", "LOCALTIME", -"LOCALTIMESTAMP", "LOCKED", "MERGE", "NATURAL", "NEW", "NOCYCLE", -"NOMAXVALUE", "NOMINVALUE", "OFFSET", "OLD", "ON", "OTHERS", -"OVER", "PARTITION", "PRECEDING", "RANGE", "RECORDS", "REFERENCING", -"REMOTE", "RENAME", "REPEATABLE", "REPLICA", "RESTART", "RETURN", -"RETURNS", "SAMPLE", "SAVEPOINT", "SEQUENCE", "SERIAL", "SERIALIZABLE", -"SESSION_USER", "SIMPLE", "SPLIT_PART", "STDIN", "STDOUT", "STREAM", -"SYMMETRIC", "TIES", "TINYINT", "TRIGGER", "UNBOUNDED", "UNCOMMITTED", -"UNENCRYPTED", "WHILE", "XMLAGG", "XMLATTRIBUTES", "XMLCOMMENT", -"XMLCONCAT", "XMLDOCUMENT", "XMLELEMENT", "XMLFOREST", "XMLNAMESPACES", -"XMLPARSE", "XMLPI", "XMLQUERY", "XMLSCHEMA", "XMLTEXT", "XMLVALIDATE") +# found from sql_scan.c and trial/error +reserved_monetdb_keywords <- sort(unique(toupper(c(.SQL92Keywords, +"ADD", "ADMIN", "AFTER", "AGGREGATE", "ALL", "ALTER", "ALWAYS", +"AND", "ANY", "ASC", "ASYMMETRIC", "ATOMIC", "AUTO_INCREMENT", +"BEFORE", "BEGIN", "BEST", "BETWEEN", "BIGINT", "BIGSERIAL", +"BINARY", "BLOB", "BY", "CALL", "CASCADE", "CASE", "CAST", "CHAIN", +"CHAR", "CHARACTER", "CHECK", "CLOB", "COALESCE", "COMMIT", "COMMITTED", +"CONSTRAINT", "CONVERT", "COPY", "CORRESPONDING", "CREATE", "CROSS", +"CURRENT", "CURRENT_DATE", "CURRENT_ROLE", "CURRENT_TIME", "CURRENT_TIMESTAMP", +"CURRENT_USER", "DAY", "DEC", "DECIMAL", "DECLARE", "DEFAULT", +"DELETE", "DELIMITERS", "DESC", "DO", "DOUBLE", "DROP", "EACH", +"EFFORT", "ELSE", "ELSEIF", "ENCRYPTED", "END", "ESCAPE", "EVERY", +"EXCEPT", "EXCLUDE", "EXISTS", "EXTERNAL", "EXTRACT", "FALSE", +"FLOAT", "FOLLOWING", "FOR", "FOREIGN", "FROM", "FULL", "FUNCTION", +"GENERATED", "GLOBAL", "GRANT", "GROUP", "HAVING", "HOUR", "HUGEINT", +"IDENTITY", "IF", "ILIKE", "IN", "INDEX", "INNER", "INSERT", +"INT", "INTEGER", "INTERSECT", "INTO", "IS", "ISOLATION", "JOIN", +"LEFT", "LIKE", "LIMIT", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", +"LOCKED", "MEDIUMINT", "MERGE", "MINUTE", "MONTH", "NATURAL", +"NEW", "NEXT", "NOCYCLE", "NOMAXVALUE", "NOMINVALUE", "NOT", +"NOW", "NULL", "NULLIF", "NUMERIC", "OF", "OFFSET", "OLD", "ON", +"ONLY", "OPTION", "OR", "ORDER", "OTHERS", "OUTER", "OVER", "PARTIAL", +"PARTITION", "POSITION", "PRECEDING", "PRESERVE", "PRIMARY", +"PRIVILEGES", "PROCEDURE", "PUBLIC", "RANGE", "READ", "REAL", +"RECORDS", "REFERENCES", "REFERENCING", "REMOTE", "RENAME", "REPEATABLE", +"REPLICA", "RESTART", "RESTRICT", "RETURN", "RETURNS", "REVOKE", +"RIGHT", "ROLLBACK", "ROWS", "SAMPLE", "SAVEPOINT", "SECOND", +"SELECT", "SEQUENCE", "SERIAL", "SERIALIZABLE", "SESSION_USER", +"SET", "SIMPLE", "SMALLINT", "SOME", "SPLIT_PART", "STDIN", "STDOUT", +"STORAGE", "STREAM", "STRING", "SUBSTRING", "SYMMETRIC", "THEN", +"TIES", "TINYINT", "TO", "TRANSACTION", "TRIGGER", "TRUE", "UNBOUNDED", +"UNCOMMITTED", "UNENCRYPTED", "UNION", "UNIQUE", "UPDATE", "USER", +"USING", "VALUES", "VARCHAR", "VARYING", "VIEW", "WHEN", "WHERE", +"WHILE", "WITH", "WORK", "WRITE", "XMLAGG", "XMLATTRIBUTES", +"XMLCOMMENT", "XMLCONCAT", "XMLDOCUMENT", "XMLELEMENT", "XMLFOREST", +"XMLNAMESPACES", "XMLPARSE", "XMLPI", "XMLQUERY", "XMLSCHEMA", +"XMLTEXT", "XMLVALIDATE", "YEAR")))) # quoting quoteIfNeeded <- function(conn, x, warn=T, ...) { _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
_______________________________________________ developers-list mailing list developers-list@monetdb.org https://www.monetdb.org/mailman/listinfo/developers-list
participants (2)
-
Hannes Mühleisen
-
martin van dinther