Changeset: f5733b8e8c16 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f5733b8e8c16
Modified Files:
        clients/mapiclient/mclient.c
        sql/ChangeLog
        sql/backends/monet5/sql_upgrades.c
        sql/scripts/51_sys_schema_extension.sql
        sql/server/sql_parser.y
        sql/server/sql_scan.c
        sql/test/miscellaneous/Tests/deallocate.sql
Branch: default
Log Message:

As per user request, just DEALLOCATE keyword will suffice, ie removed DEALLOC 
abbreviation


diffs (120 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2452,7 +2452,7 @@ doFile(Mapi mid, stream *fp, bool useins
                                break;
                        case 'e':
                        case 'E':
-                               /* a bit of a hack for prepare/exec/dealloc
+                               /* a bit of a hack for prepare/exec/deallocate
                                 * tests: replace "exec[ute] **" with the
                                 * ID of the last prepared statement */
                                if (mode == SQL && formatter == TESTformatter) {
@@ -2470,17 +2470,12 @@ doFile(Mapi mid, stream *fp, bool useins
                                break;
                        case 'd':
                        case 'D':
-                               /* a bit of a hack for prepare/exec/dealloc
-                                * tests: replace "dealloc[ate] **" with the
+                               /* a bit of a hack for prepare/exec/deallocate
+                                * tests: replace "deallocate **" with the
                                 * ID of the last prepared statement */
-                               if (mode == SQL && formatter == TESTformatter) {
-                                       if (strncasecmp(line, "dealloc **", 10) 
== 0) {
-                                               line[8] = prepno < 10 ? ' ' : 
prepno / 10 + '0';
-                                               line[9] = prepno % 10 + '0';
-                                       } else if (strncasecmp(line, 
"deallocate **", 13) == 0) {
-                                               line[11] = prepno < 10 ? ' ' : 
prepno / 10 + '0';
-                                               line[12] = prepno % 10 + '0';
-                                       }
+                               if (mode == SQL && formatter == TESTformatter 
&& strncasecmp(line, "deallocate **", 13) == 0) {
+                                       line[11] = prepno < 10 ? ' ' : prepno / 
10 + '0';
+                                       line[12] = prepno % 10 + '0';
                                }
                                break;
                        case 'q':
diff --git a/sql/ChangeLog b/sql/ChangeLog
--- a/sql/ChangeLog
+++ b/sql/ChangeLog
@@ -2,7 +2,7 @@
 # This file is updated with Maddlog
 
 * Fri Dec 13 2019 Pedro Ferreira <pedro.ferre...@monetdbsolutions.com>
-- Added deallocate statements with the syntax 'DEALLOC[ATE] [PREPARE]
+- Added deallocate statements with the syntax 'DEALLOCATE [PREPARE]
   { number | ALL }', to close an existing prepared statement or all, 
   through the SQL layer. Previously this feature was available via MAPI 
   exclusively with the "release" command.
diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -2521,7 +2521,7 @@ sql_update_default(Client c, mvc *sql, c
 
        pos += snprintf(buf + pos, bufsize - pos,
                        "ALTER TABLE sys.keywords SET READ WRITE;\n"
-                       "insert into sys.keywords values ('CUBE'), ('DEALLOC'), 
('DEALLOCATE'), ('GROUPING'), ('ROLLUP'), ('SETS');\n");
+                       "insert into sys.keywords values ('CUBE'), 
('DEALLOCATE'), ('GROUPING'), ('ROLLUP'), ('SETS');\n");
 
        pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
        pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", 
prev_schema);
diff --git a/sql/scripts/51_sys_schema_extension.sql 
b/sql/scripts/51_sys_schema_extension.sql
--- a/sql/scripts/51_sys_schema_extension.sql
+++ b/sql/scripts/51_sys_schema_extension.sql
@@ -60,7 +60,6 @@ INSERT INTO sys.keywords (keyword) VALUE
   ('CURRENT_TIMESTAMP'),
   ('CURRENT_USER'),
   ('DAY'),
-  ('DEALLOC'),
   ('DEALLOCATE'),
   ('DEC'),
   ('DECIMAL'),
diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -694,7 +694,7 @@ SQLCODE SQLERROR UNDER WHENEVER
 %token CHECK CONSTRAINT CREATE COMMENT NULLS FIRST LAST
 %token TYPE PROCEDURE FUNCTION sqlLOADER AGGREGATE RETURNS EXTERNAL sqlNAME 
DECLARE
 %token CALL LANGUAGE
-%token ANALYZE MINMAX SQL_EXPLAIN SQL_PLAN SQL_DEBUG SQL_TRACE PREP PREPARE 
EXEC EXECUTE DEALLOC DEALLOCATE
+%token ANALYZE MINMAX SQL_EXPLAIN SQL_PLAN SQL_DEBUG SQL_TRACE PREP PREPARE 
EXEC EXECUTE DEALLOCATE
 %token DEFAULT DISTINCT DROP TRUNCATE
 %token FOREIGN
 %token RENAME ENCRYPTED UNENCRYPTED PASSWORD GRANT REVOKE ROLE ADMIN INTO
@@ -816,7 +816,6 @@ opt_prepare:
 
 deallocate:
    DEALLOCATE
- | DEALLOC
  ;
 
 create:
@@ -5761,7 +5760,6 @@ non_reserved_word:
 | CLIENT       { $$ = sa_strdup(SA, "client"); }
 | COMMENT      { $$ = sa_strdup(SA, "comment"); }
 | DATA                 { $$ = sa_strdup(SA, "data"); }
-| DEALLOC   { $$ = sa_strdup(SA, "dealloc"); }
 | DECADE       { $$ = sa_strdup(SA, "decade"); }
 | SQL_DEBUG    { $$ = sa_strdup(SA, "debug"); }
 | DIAGNOSTICS  { $$ = sa_strdup(SA, "diagnostics"); }
diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -385,7 +385,6 @@ scanner_init_keywords(void)
        failed += keywords_insert("PREP", PREP);
        failed += keywords_insert("EXECUTE", EXECUTE);
        failed += keywords_insert("EXEC", EXEC);
-       failed += keywords_insert("DEALLOC", DEALLOC);
        failed += keywords_insert("DEALLOCATE", DEALLOCATE);
 
        failed += keywords_insert("INDEX", INDEX);
diff --git a/sql/test/miscellaneous/Tests/deallocate.sql 
b/sql/test/miscellaneous/Tests/deallocate.sql
--- a/sql/test/miscellaneous/Tests/deallocate.sql
+++ b/sql/test/miscellaneous/Tests/deallocate.sql
@@ -1,6 +1,6 @@
 prepare select "system" or ? from _tables WHERE false;
 EXEC **(false);
-dealloc **;
+deallocate **;
 exec **(false); --error, the last prepared statement, no longer exists;
 DEALLOCATE **; --error, last prepared statement already closed
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to