]> granicus.if.org Git - postgresql/commitdiff
SQL defines are only used in SQL space in Informix mode.
authorMichael Meskes <meskes@postgresql.org>
Mon, 26 Jul 2004 10:28:28 +0000 (10:28 +0000)
committerMichael Meskes <meskes@postgresql.org>
Mon, 26 Jul 2004 10:28:28 +0000 (10:28 +0000)
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/preproc/pgc.l

index 97e37eaf3edff876ca36659166d165bd208d159c..d1dae49a7337e2251bbdf67937a7fa1936749764 100644 (file)
@@ -1850,6 +1850,10 @@ Tue Jul 20 09:15:21 CEST 2004
 
        - Synced parser and keyword list.
        - Fixed handling of cyclic defines.
+       
+Mon Jul 26 09:04:53 CEST 2004
+
+       - SQL defines are only used in SQL space in Informix mode.
        - Set pgtypes library version to 1.2.
        - Set ecpg version to 3.2.0.
        - Set compat library version to 1.2.
index 28578a395430a663fbfa1db4b5bab6ce03fab5e3..1a2ccc6ee014feed2dee204f7492fae646a7d598 100644 (file)
@@ -12,7 +12,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.130 2004/07/20 18:06:41 meskes Exp $
+ *       $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.131 2004/07/26 10:28:28 meskes Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -693,24 +693,32 @@ cppline                   {space}*#(.*\\{space})+.*
                                                ScanKeyword             *keyword;
                                                struct _defines *ptr;
 
-                                               /* is it a define? */
-                                               for (ptr = defines; ptr; ptr = ptr->next)
+                                               if (INFORMIX_MODE)
                                                {
-                                                       if (strcmp(yytext, ptr->old) == 0 && ptr->used == NULL)
+                                                       /* Informix uses SQL defines only in SQL space */
+                                                       ptr = NULL;
+                                               }
+                                               else
+                                               {
+                                                       /* is it a define? */
+                                                       for (ptr = defines; ptr; ptr = ptr->next)
                                                        {
-                                                               struct _yy_buffer *yb;
+                                                               if (strcmp(yytext, ptr->old) == 0 && ptr->used == NULL)
+                                                               {
+                                                                       struct _yy_buffer *yb;
 
-                                                               yb = mm_alloc(sizeof(struct _yy_buffer));
+                                                                       yb = mm_alloc(sizeof(struct _yy_buffer));
 
-                                                               yb->buffer =  YY_CURRENT_BUFFER;
-                                                               yb->lineno = yylineno;
-                                                               yb->filename = mm_strdup(input_filename);
-                                                               ptr->used = yb->next = yy_buffer;
+                                                                       yb->buffer =  YY_CURRENT_BUFFER;
+                                                                       yb->lineno = yylineno;
+                                                                       yb->filename = mm_strdup(input_filename);
+                                                                       ptr->used = yb->next = yy_buffer;
 
-                                                               yy_buffer = yb;
+                                                                       yy_buffer = yb;
 
-                                                               yy_scan_string(ptr->new);
-                                                               break;
+                                                                       yy_scan_string(ptr->new);
+                                                                       break;
+                                                               }
                                                        }
                                                }