List:Internals« Previous MessageNext Message »
From:Antony T Curtis Date:March 22 2004 2:12pm
Subject:bk commit into 5.0 tree (antony:1.1666)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of antony. When antony does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.1666 04/03/22 14:12:10 antony@stripped +8 -0
  WorkLog 1288
    Build cleanups and start of implementing actions

  sql/parser_sql.g
    1.9 04/03/22 14:12:05 antony@stripped +0 -3
    Remove unused defines

  sql/parser_sql.g
    1.8 04/03/22 12:02:19 antony@stripped +480 -155
    Reinsert some grammar resolutions,
    Tidy up indent/style

  sql/item.h
    1.80 04/03/22 12:02:19 antony@stripped +13 -0
    New class: Item_bitbinary

  sql/item.cc
    1.82 04/03/22 12:02:19 antony@stripped +71 -0
    New class: Item_bitbinary

  sql/sql_db.cc
    1.79 04/03/22 04:12:52 antony@stripped +50 -0
    New function:
      mysql_check_db()

  sql/parser_sql.g
    1.7 04/03/22 04:12:52 antony@stripped +131 -93
    Start adding in semantic predicates
    add missing integer_numeric_literal rule

  sql/parser_base.h
    1.4 04/03/22 04:12:52 antony@stripped +78 -0
    Define some parser support methods:
      isCatalogName()
      isSchemaName()
      isDomainName()
      isQueryName()
      isUserTypeName()
      isSQLParameterName()
      isDatabaseName()

  sql/parser_base.cc
    1.6 04/03/22 04:12:52 antony@stripped +7 -7
    revert some bogus changes

  sql/parser_abase.h
    1.4 04/03/22 04:12:52 antony@stripped +11 -13
    revert some bogus changes

  sql/mysql_priv.h
    1.213 04/03/22 04:12:51 antony@stripped +1 -0
    New function:
      mysql_check_db()

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	antony
# Host:	ltantony.rdg.cyberkinetica.com
# Root:	/usr/home/antony/work/wl1288

--- 1.81/sql/item.cc	Fri Feb 13 16:38:55 2004
+++ 1.82/sql/item.cc	Mon Mar 22 12:02:19 2004
@@ -1343,6 +1343,77 @@
   return (error) ? -1 :  0;
 }
 
+/****************************************************************************
+** bitbinary item
+** In string context this is a binary string
+** In number context this is a longlong value.
+****************************************************************************/
+
+Item_bitbinary::Item_bitbinary(const char *str, uint str_length)
+{
+  name=(char*) str;
+  max_length=(str_length+7)/8;
+  char *ptr=(char*) sql_alloc(max_length+1);
+  if (!ptr)
+    return;
+  str_value.set(ptr,max_length,&my_charset_bin);
+  char *end=ptr+max_length;
+  while (str_length)
+  {
+    char v=0;
+    switch (str_length & 7) 
+    {
+    case 0:
+      v=  (*str++) == '1' ? 0x80 : 0; str_length--;
+    case 7:
+      v|= (*str++) == '1' ? 0x40 : 0; str_length--;
+    case 6:
+      v|= (*str++) == '1' ? 0x20 : 0; str_length--;
+    case 5:
+      v|= (*str++) == '1' ? 0x10 : 0; str_length--;
+    case 4:
+      v|= (*str++) == '1' ? 0x08 : 0; str_length--;
+    case 3:
+      v|= (*str++) == '1' ? 0x04 : 0; str_length--;
+    case 2:
+      v|= (*str++) == '1' ? 0x02 : 0; str_length--;
+    case 1:
+      v|= (*str++) == '1' ? 0x01 : 0; str_length--;
+    }
+    *ptr++= v;
+  }  
+  *ptr=0;					// Keep purify happy
+  collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
+}
+
+longlong Item_bitbinary::val_int()
+{
+  char *end=(char*) str_value.ptr()+str_value.length(),
+       *ptr=end-min(str_value.length(),sizeof(longlong));
+
+  ulonglong value=0;
+  for (; ptr != end ; ptr++)
+    value=(value << 8)+ (ulonglong) (uchar) *ptr;
+  return (longlong) value;
+}
+
+
+int Item_bitbinary::save_in_field(Field *field, bool no_conversions)
+{
+  int error;
+  field->set_notnull();
+  if (field->result_type() == STRING_RESULT)
+  {
+    error=field->store(str_value.ptr(),str_value.length(),collation.collation);
+  }
+  else
+  {
+    longlong nr=val_int();
+    error=field->store(nr);
+  }
+  return (error) ? -1 :  0;
+}
+
 
 /*
   Pack data in buffer for sending

--- 1.79/sql/item.h	Wed Feb 11 17:21:53 2004
+++ 1.80/sql/item.h	Mon Mar 22 12:02:19 2004
@@ -679,6 +679,19 @@
   enum_field_types field_type() const { return MYSQL_TYPE_STRING; }
 };
 
+class Item_bitbinary :public Item
+{
+public:
+  Item_bitbinary(const char *str,uint str_length);
+  enum Type type() const { return VARBIN_ITEM; }
+  double val() { return (double) Item_bitbinary::val_int(); }
+  longlong val_int();
+  String *val_str(String*) { return &str_value; }
+  int save_in_field(Field *field, bool no_conversions);
+  enum Item_result result_type () const { return STRING_RESULT; }
+  enum_field_types field_type() const { return MYSQL_TYPE_STRING; }
+};
+
 
 class Item_result_field :public Item	/* Item with result field */
 {

--- 1.212/sql/mysql_priv.h	Wed Mar 17 15:41:25 2004
+++ 1.213/sql/mysql_priv.h	Mon Mar 22 04:12:51 2004
@@ -448,6 +448,7 @@
 		   const char *table_name);
 bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list);
 bool mysql_change_db(THD *thd,const char *name);
+bool mysql_check_db(THD *thd,const char *name,int length);
 void mysql_parse(THD *thd,char *inBuf,uint length);
 bool is_update_query(enum enum_sql_command command);
 void free_items(Item *item);

--- 1.78/sql/sql_db.cc	Tue Feb 10 15:58:53 2004
+++ 1.79/sql/sql_db.cc	Mon Mar 22 04:12:52 2004
@@ -663,3 +663,53 @@
   DBUG_RETURN(0);
 }
 
+/*
+  Check database.
+
+  SYNOPSIS
+    mysql_check_db()
+    thd		Thread handler
+    name	Databasename
+
+  DESCRIPTION
+
+  RETURN VALUES
+    0	ok
+    1	error
+*/
+
+bool mysql_check_db(THD *thd, const char *name, int db_length)
+{
+  int length, result=1;
+  char *dbname=my_strdup((char*) name,MYF(MY_WME));
+  char	path[FN_REFLEN];
+  ulong db_access;
+  DBUG_ENTER("mysql_check_db");
+
+  if ((db_length > NAME_LEN) || check_db_name(dbname))
+    goto fail;
+
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+  if (test_all_bits(thd->master_access,DB_ACLS))
+    db_access=DB_ACLS;
+  else
+    db_access= (acl_get(thd->host,thd->ip, thd->priv_user,dbname,0) |
+		thd->master_access);
+  if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname)))
+    goto fail;
+#endif
+  (void) sprintf(path,"%s/%s",mysql_data_home,dbname);
+  length=unpack_dirname(path,path);		// Convert if not unix
+  if (length && path[length-1] == FN_LIBCHAR)
+    path[length-1]=0;				// remove ending '\'
+  if (access(path,F_OK))
+    goto fail;
+
+  result=0;
+
+fail:
+  x_free(dbname);
+
+  DBUG_RETURN(result);
+}
+

--- 1.3/sql/parser_abase.h	Wed Mar 17 15:41:25 2004
+++ 1.4/sql/parser_abase.h	Mon Mar 22 04:12:52 2004
@@ -86,17 +86,17 @@
 
 /* these need to be macros not member functions */
 #define zzGUESS_BLOCK		ANTLRParserState zzst; int zzrv; int _marker; int zzGuessSeqFrozen;
-#define zzNON_GUESS_MODE	if ( !(*get_guessing()) )
+#define zzNON_GUESS_MODE	if ( !(guessing) )
 #define zzGUESS_FAIL		guess_fail();
 
 /*  Note:  zzGUESS_DONE does not execute longjmp() */
 
 #define zzGUESS_DONE		{zzrv=1; inputTokens->rewind(_marker); guess_done(&zzst);zzUSER_GUESS_DONE_HOOK(zzGuessSeqFrozen) }
 #define zzGUESS				saveState(&zzst); \
-							(*get_guessing()) = 1; \
+							guessing = 1; \
                             zzGuessSeqFrozen = ++zzGuessSeq; \
 							_marker = inputTokens->mark(); \
-							zzrv = setjmp(get_guess_start()->state); \
+							zzrv = setjmp(guess_start.state); \
                             zzUSER_GUESS_HOOK(zzGuessSeqFrozen,zzrv) \
 						    if ( zzrv ) zzGUESS_DONE
 
@@ -154,10 +154,8 @@
 
 	ANTLRTokenBuffer *inputTokens;	//place to get input tokens
 
-	zzjmp_buf _guess_start;		// where to jump back to upon failure
-	int _guessing;				// if guessing (using (...)? predicate)
-	/*virtual*/ zzjmp_buf *get_guess_start() { return &_guess_start; }
-	/*virtual*/ int *get_guessing() { return &_guessing; }
+	zzjmp_buf guess_start;		// where to jump back to upon failure
+	int guessing;				// if guessing (using (...)? predicate)
 
 	// infinite lookahead stuff
 	int can_use_inf_look;		// set by subclass (generated by ANTLR)
@@ -184,7 +182,7 @@
 
 protected:
 	/*virtual*/ void guess_fail() {                         // MR9 27-Sep-97 make virtual
-        longjmp(get_guess_start()->state, 1); }                // MR9
+        longjmp(guess_start.state, 1); }                // MR9
 	/*virtual*/ void guess_done(ANTLRParserState *st) {     // MR9 27-Sep-97 make virtual
          restoreState(st); }                            // MR9
 	/*virtual*/ int guess(ANTLRParserState *);              // MR9 27-Sep-97 make virtual
@@ -282,14 +280,14 @@
 				 (_ANTLRTokenPtr *) &zzBadTok, &zzMissSet) ) goto fail;
 
 #define zzmatch_wsig(_t,handler)						\
-	if ( !_match_wsig((ANTLRTokenType)_t) ) if ( *get_guessing() ) zzGUESS_FAIL else {_signal=MismatchedToken; goto handler;}
+	if ( !_match_wsig((ANTLRTokenType)_t) ) if ( guessing ) zzGUESS_FAIL else {_signal=MismatchedToken; goto handler;}
 
 #define zzsetmatch(_ts,_tokclassErrset)							\
 	if ( !_setmatch(_ts, &zzMissText, &zzMissTok, \
 				 (_ANTLRTokenPtr *) &zzBadTok, &zzMissSet, _tokclassErrset) ) goto fail;
 
 #define zzsetmatch_wsig(_ts, handler)				\
-	if ( !_setmatch_wsig(_ts) ) if ( *get_guessing() ) zzGUESS_FAIL else {_signal=MismatchedToken; goto handler;}
+	if ( !_setmatch_wsig(_ts) ) if ( guessing ) zzGUESS_FAIL else {_signal=MismatchedToken; goto handler;}
 
 /* For the dflt signal matchers, a FALSE indicates that an error occurred
  * just like the other matchers, but in this case, the routine has already
@@ -315,7 +313,7 @@
 
 #ifndef zzfailed_pred
 #define zzfailed_pred(_p,_hasuseraction,_useraction) \
-  if (*get_guessing()) { \
+  if (guessing) { \
     zzGUESS_FAIL; \
   } else { \
     zzfailed_pred_action(_p,_hasuseraction,_useraction) \
@@ -323,10 +321,10 @@
 #endif
 
 #define zzIS_GUESSING \
-  if (*get_guessing())
+  if (guessing)
 
 #define zzISNOT_GUESSING \
-  if (!*get_guessing())
+  if (!guessing)
 
 //  MR23            Provide more control over failed predicate action
 //                  without any need for user to worry about guessing internals.

--- 1.5/sql/parser_base.cc	Sun Mar 21 22:14:28 2004
+++ 1.6/sql/parser_base.cc	Mon Mar 22 04:12:52 2004
@@ -578,7 +578,7 @@
   /* MR14 */    };
   demand_look = 0;    /* demand_look = dlook; */
   bsetsize = ssize;
-  *(get_guessing()) = 0;
+  guessing = 0;
   token_tbl = NULL;
   eofToken = (ANTLRTokenType)1;
 
@@ -631,8 +631,8 @@
 guess(ANTLRParserState *st)
 {
   saveState(st);
-  *(get_guessing()) = 1;
-  return setjmp((*get_guess_start()).state);
+  guessing = 1;
+  return setjmp(guess_start.state);
 }
 #ifdef _MSC_VER  // MR23
 #pragma warning(default: 4611)
@@ -641,8 +641,8 @@
 void ANTLRParser::
 saveState(ANTLRParserState *buf)
 {
-  buf->guess_start = *get_guess_start();
-  buf->guessing = *get_guessing();
+  buf->guess_start = guess_start;
+  buf->guessing = guessing;
   buf->inf_labase = inf_labase;
   buf->inf_last = inf_last;
   buf->dirty = dirty;
@@ -653,8 +653,8 @@
 {
   int     i;
 
-  *(get_guess_start()) = buf->guess_start;
-  *(get_guessing()) = buf->guessing;
+  guess_start = buf->guess_start;
+  guessing = buf->guessing;
   inf_labase = buf->inf_labase;
   inf_last = buf->inf_last;
   dirty = buf->dirty;

--- 1.3/sql/parser_base.h	Sun Mar 21 22:14:28 2004
+++ 1.4/sql/parser_base.h	Mon Mar 22 04:12:52 2004
@@ -22,6 +22,7 @@
 #endif
 
 #include APARSER_H
+#include ATOKPTR_H
 
 #ifndef _MYSQL_PRIV_H_
 #define _MYSQL_PRIV_H_
@@ -52,6 +53,83 @@
     _can_fail(0), thd(NULL) { }
   
   THD *thd;
+
+  bool isCatalogName(String *name)
+  {
+    return !strcmp(name->c_ptr(),thd->catalog);
+  }
+  
+  bool isCatalogName(ANTLRTokenPtr token)
+  {
+    String name= token->getString();
+    return isCatalogName(&name);
+  }
+
+  bool isSchemaName(String *name)
+  {
+    return 0;
+  }
+  
+  bool isSchemaName(ANTLRTokenPtr token)
+  {
+    String name= token->getString();
+    return isSchemaName(&name);
+  }
+
+  bool isDomainName(String *name)
+  {
+    return 0;
+  }
+  
+  bool isDomainName(ANTLRTokenPtr token)
+  {
+    String name= token->getString();
+    return isDomainName(&name);
+  }
+
+  bool isQueryName(String *name)
+  {
+    return 0;
+  }
+  
+  bool isQueryName(ANTLRTokenPtr token)
+  {
+    String name= token->getString();
+    return isQueryName(&name);
+  }
+
+  bool isUserTypeName(String *name)
+  {
+    return 0;
+  }
+  
+  bool isUserTypeName(ANTLRTokenPtr token)
+  {
+    String name= token->getString();
+    return isUserTypeName(&name);
+  }
+
+  bool isSQLParameterName(String *name)
+  {
+    return 0;
+  }
+  
+  bool isSQLParameterName(ANTLRTokenPtr token)
+  {
+    String name= token->getString();
+    return isSQLParameterName(&name);
+  }
+
+  bool isDatabaseName(String *name)
+  {
+    return !mysql_check_db(thd, name->c_ptr(), name->length());
+  }
+  
+  bool isDatabaseName(ANTLRTokenPtr token)
+  {
+    String name= token->getString();
+    return isDatabaseName(&name);
+  }
   
   /* ENTRY INTO PARSER */
   virtual void parse_multi_statement(void)=0;

--- 1.6/sql/parser_sql.g	Sun Mar 21 23:21:37 2004
+++ 1.9/sql/parser_sql.g	Mon Mar 22 14:12:05 2004
@@ -15,14 +15,11 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-#define MYSQL_YACC
-
 #include "lex.h"
 #include "parser_base.h"
 >>
 
 #lexaction <<
-#define IN_LEXER
 #include "lex_symbol.h"
 
 /*
@@ -926,30 +923,39 @@
 	;
 
 character_set_name :
-	  catalog_name PERIOD unqualified_schema_name PERIOD sql_language_identifier
-	| unqualified_schema_name PERIOD sql_language_identifier
+	  schema_name PERIOD sql_language_identifier
 	| sql_language_identifier
 	;
 
 schema_name :
-	  catalog_name PERIOD unqualified_schema_name
+	  ( qualified_schema_name )? qualified_schema_name
 	| unqualified_schema_name
 	;
 
-catalog_name>[String *result] :
-	  ( <<String ident;>>
-	    regular_identifier>[ident]
-	    <<$result= new String(ident);>>
-	  )
-	| delimited_identifier>[$result]
+qualified_schema_name :
+	  catalog_name PERIOD unqualified_schema_name
 	;
 
 unqualified_schema_name>[String *result] :
-	  ( <<String ident;>>
-	    regular_identifier>[ident]
-	    <<$result= new String(ident);>>
-	  )
-	| delimited_identifier>[$result]
+	  (REGULAR_IDENT|DELIMITED_IDENT)?=><<isSchemaName(LT(1))>>?[
+	    failedSemanticPredicate("<schema name> expected");
+	  ]
+	  actual_identifier>[$result]
+	;
+
+
+catalog_name>[String *result] :
+	  (REGULAR_IDENT|DELIMITED_IDENT)?=><<isCatalogName(LT(1))>>?[
+	    failedSemanticPredicate("<catalog name> expected");
+	  ]
+	  actual_identifier>[$result]
+	;
+
+database_name>[String *result] :
+	  (REGULAR_IDENT|DELIMITED_IDENT)?=><<isDatabaseName(LT(1))>>?[
+	    failedSemanticPredicate("<database name> expected");
+	  ]
+	  actual_identifier>[$result]
 	;
 
 language_clause :
@@ -994,11 +1000,14 @@
 	;
 
 user_defined_type_name :
-	  schema_qualified_type_name
+	  { (schema_name PERIOD)? schema_name PERIOD } unqualified_type_name
 	;
-
-schema_qualified_type_name :
-	  { schema_name PERIOD } qualified_identifier
+	
+unqualified_type_name :
+	  (REGULAR_IDENT|DELIMITED_IDENT)?=><<isUserTypeName(LT(1))>>?[
+	    failedSemanticPredicate("<user type> expected");
+	  ]
+	  qualified_identifier
 	;
 
 qualified_identifier>[String *result] :
@@ -1006,16 +1015,24 @@
 	;
 
 table_name :
-	  local_or_schema_qualified_name
-	;
-
-local_or_schema_qualified_name :
-	  { local_or_schema_qualifier PERIOD } qualified_identifier
+	  unqualified_table_name
+	| qualified_table_name
 	;
 
-local_or_schema_qualifier :
-	  schema_name
-	| MODULE
+unqualified_table_name :
+	  (REGULAR_IDENT|DELIMITED_IDENT|SQL3_NON_RESERVED_WORDS)?=>
+	  <<!(isCatalogName(LT(1))||isSchemaName(LT(1))||isDatabaseName(LT(1)))>>?[
+	    failedSemanticPredicate("<table name> expected");
+	  ]
+	    qualified_identifier
+	  ;
+
+
+qualified_table_name :
+	  ( MODULE PERIOD
+	  | schema_name PERIOD 
+	  | database_name PERIOD )
+	  qualified_identifier
 	;
 
 table_element_list :
@@ -1034,7 +1051,11 @@
 	;
 
 column_definition :
-	  ( domain_name | data_type ) { reference_scope_check } { default_clause } ( column_constraint_definition )* { collate_clause }
+	  ( domain_name | data_type ) 
+	  { ( REFERENCES ARE )? reference_scope_check } 
+	  { default_clause } 
+	  ( column_constraint_definition )* 
+	  { collate_clause }
 	;
 
 column_name>[String *result] :
@@ -1042,7 +1063,11 @@
 	;
 
 data_type :
-	  ( predefined_type | row_type | user_defined_type | reference_type ) ( array_specification )*
+	  ( predefined_type 
+	  | row_type 
+	  | user_defined_type 
+	  | reference_type ) 
+	  ( array_specification )*
 	;
 
 predefined_type :
@@ -1057,7 +1082,11 @@
 	;
 
 character_string_type :
-	  CHARACTER_SYM ( VARYING LEFT_PAREN length RIGHT_PAREN | LARGE OBJECT { LEFT_PAREN large_object_length RIGHT_PAREN } | { LEFT_PAREN length RIGHT_PAREN } )
+	  CHARACTER_SYM 
+	  ( VARYING LEFT_PAREN length RIGHT_PAREN 
+	  | LARGE OBJECT { LEFT_PAREN large_object_length RIGHT_PAREN } 
+	  | { LEFT_PAREN length RIGHT_PAREN } 
+	  )
 	| VARCHAR LEFT_PAREN length RIGHT_PAREN
 	| CLOB { LEFT_PAREN large_object_length RIGHT_PAREN }
 	;
@@ -1077,7 +1106,11 @@
 	;
 
 national_character_string_type :
-	  ( NATIONAL CHARACTER_SYM | NCHAR ) ( VARYING LEFT_PAREN length RIGHT_PAREN | LARGE OBJECT { LEFT_PAREN large_object_length RIGHT_PAREN } | { LEFT_PAREN length RIGHT_PAREN } )
+	  ( NATIONAL CHARACTER_SYM | NCHAR ) 
+	  ( VARYING LEFT_PAREN length RIGHT_PAREN 
+	  | LARGE OBJECT { LEFT_PAREN large_object_length RIGHT_PAREN } 
+	  | { LEFT_PAREN length RIGHT_PAREN } 
+	  )
 	| NCLOB { LEFT_PAREN large_object_length RIGHT_PAREN }
 	;
 
@@ -1087,7 +1120,9 @@
 	;
 
 bit_string_type :
-	  BIT ( VARYING LEFT_PAREN length RIGHT_PAREN | { LEFT_PAREN length RIGHT_PAREN } )
+	  BIT 
+	  ( VARYING LEFT_PAREN length RIGHT_PAREN 
+	  | { LEFT_PAREN length RIGHT_PAREN } )
 	;
 
 numeric_type :
@@ -1121,8 +1156,10 @@
 
 datetime_type :
 	  DATE
-	| TIME_SYM { LEFT_PAREN time_precision RIGHT_PAREN } { with_or_without_time_zone }
-	| TIMESTAMP { LEFT_PAREN timestamp_precision RIGHT_PAREN } { with_or_without_time_zone }
+	| TIME_SYM { LEFT_PAREN time_precision RIGHT_PAREN } 
+	  { ( WITHOUT | WITH TIME_SYM )? with_or_without_time_zone }
+	| TIMESTAMP { LEFT_PAREN timestamp_precision RIGHT_PAREN } 
+	  { ( WITHOUT | WITH TIME_SYM )? with_or_without_time_zone }
 	;
 
 time_precision :
@@ -1181,8 +1218,13 @@
 	;
 
 single_datetime_field :
-	  non_second_primary_datetime_field { LEFT_PAREN interval_leading_field_precision RIGHT_PAREN }
-	| SECOND { LEFT_PAREN interval_leading_field_precision { COMMA interval_fractional_seconds_precision } RIGHT_PAREN }
+	  non_second_primary_datetime_field 
+	  { LEFT_PAREN interval_leading_field_precision RIGHT_PAREN }
+	| SECOND 
+	  { LEFT_PAREN interval_leading_field_precision 
+	    { COMMA interval_fractional_seconds_precision } 
+	    RIGHT_PAREN 
+	  }
 	;
 
 row_type :
@@ -1202,7 +1244,8 @@
 	;
 
 reference_scope_check :
-	  REFERENCES ARE { NOT } CHECKED { ON DELETE reference_scope_check_action }
+	  REFERENCES ARE { NOT } CHECKED 
+	  { ON DELETE reference_scope_check_action }
 	;
 
 reference_scope_check_action :
@@ -1225,7 +1268,8 @@
 	;
 
 schema_qualified_name :
-	  { schema_name PERIOD } qualified_identifier
+	  { (schema_name PERIOD)? schema_name PERIOD } 
+	  qualified_identifier
 	;
 
 reference_type :
@@ -1241,7 +1285,8 @@
 	;
 
 array_specification :
-	  collection_type_constructor LEFT_BRACKET_SYM UNSIGNED_INTEGER RIGHT_BRACKET_SYM
+	  collection_type_constructor 
+	  LEFT_BRACKET_SYM UNSIGNED_INTEGER RIGHT_BRACKET_SYM
 	;
 
 collection_type_constructor :
@@ -1249,16 +1294,15 @@
 	;
 
 domain_name :
-	  schema_name PERIOD unqualified_domain_name
+	  (schema_name PERIOD)? schema_name PERIOD unqualified_domain_name
 	| unqualified_domain_name
 	;
 
 unqualified_domain_name>[String *result] :
-	  ( <<String ident;>>
-	    regular_identifier>[ident]
-	    <<$result= new String(ident);>>
-	  )
-	| delimited_identifier>[$result]
+	  (REGULAR_IDENT|DELIMITED_IDENT)?=><<isDomainName(LT(1))>>?[
+	    failedSemanticPredicate("<domain name> expected");
+	  ]
+	  actual_identifier>[$result]
 	;
 
 default_clause :
@@ -1289,7 +1333,8 @@
 	;
 
 unsigned_numeric_literal>[Item *result] :
-	  exact_numeric_literal>[$result]
+	  integer_numeric_literal>[$result]
+	| exact_numeric_literal>[$result]
 	| approximate_numeric_literal>[$result]
 	;
 
@@ -1357,7 +1402,8 @@
 	;
 
 interval_literal :
-	  INTERVAL_SYM { PLUS_SIGN | MINUS_SIGN } INTERVAL_STRING interval_qualifier
+	  INTERVAL_SYM { PLUS_SIGN | MINUS_SIGN } 
+	  INTERVAL_STRING interval_qualifier
 	;
 
 datetime_value_function :
@@ -1402,7 +1448,10 @@
 	;
 
 column_constraint_definition :
-	  { constraint_name_definition } column_constraint { constraint_characteristics }
+	  { constraint_name_definition } 
+	  column_constraint 
+	  { (INITIALLY|DEFERRABLE|NOT DEFERRABLE)? 
+	    constraint_characteristics }
 	;
 
 constraint_name_definition :
@@ -1426,7 +1475,8 @@
 	;
 
 references_specification :
-	  REFERENCES referenced_table_and_columns { MATCH match_type } { referential_triggered_action }
+	  REFERENCES referenced_table_and_columns 
+	  { MATCH match_type } { referential_triggered_action }
 	;
 
 referenced_table_and_columns :
@@ -1448,7 +1498,9 @@
 	;
 
 referential_triggered_action :
-	  ON ( update_rule { ON delete_rule } | delete_rule { ON update_rule } )
+	  ON 
+	  ( update_rule { ON delete_rule } 
+	  | delete_rule { ON update_rule } )
 	;
 
 update_rule :
@@ -1530,23 +1582,32 @@
 	  exists_predicate>[$result]
 	| unique_predicate>[$result]
 	| simple_value_expression>[$result] 
-	  { comparison_predicate[$result]>[$result] 
-	  | match_predicate 
-	  | overlaps_predicate 
-	  | { NOT } 
-	    ( like_predicate 
-	    | similar_predicate 
-	    | between_predicate 
-	    | in_predicate 
-	    ) 
-	  | IS 
-	    ( { NOT } 
-	      ( null_predicate 
-	      | type_predicate 
-	      ) 
-	    | distinct_predicate 
+	  { boolean_operator[$result]>[$result] }
+	;
+	
+boolean_operator[Item *lhs]>[Item *result] :
+	  comparison_predicate[$result]>[$result] 
+	| match_predicate[$result]>[$result]  
+	| overlaps_predicate[$result]>[$result]  
+	| NOT
+	  ( like_predicate[1,$result]>[$result]  
+	  | similar_predicate[1,$result]>[$result]  
+	  | between_predicate[1,$result]>[$result]  
+	  | in_predicate[1,$result]>[$result]  
+	  ) 
+	| like_predicate[0,$result]>[$result]  
+	| similar_predicate[0,$result]>[$result]  
+	| between_predicate[0,$result]>[$result]  
+	| in_predicate[0,$result]>[$result]  
+	| IS 
+	  ( NOT
+	    ( null_predicate[1,$result]>[$result]  
+	    | type_predicate[1,$result]>[$result]  
 	    ) 
-	  }
+	  | null_predicate[0,$result]>[$result]  
+	  | type_predicate[0,$result]>[$result]  
+	  | distinct_predicate[$result]>[$result]  
+	  ) 
 	;
 
 simple_value_expression>[Item *result] :
@@ -1590,9 +1651,11 @@
 	;
 
 numeric_factor>[Item *result] :
-	  { PLUS_SIGN } numeric_primary>[$result] { time_zone }
-	| MINUS_SIGN numeric_primary>[$result] { time_zone }
-	  <<$result= new Item_func_neg($result);>>
+	  ( { PLUS_SIGN } numeric_primary>[$result] 
+	  | MINUS_SIGN numeric_primary>[$result] 
+	    <<$result= new Item_func_neg($result);>>
+	  )
+	  { ( AT ( LOCAL | TIME_SYM ) )? time_zone }
 	;
 
 numeric_primary>[Item *result] :
@@ -1631,7 +1694,7 @@
 basic_expression>[Item *result] :
 	  value_expression_primary>[$result] 
 	  ( LEFT_BRACKET_SYM numeric_value_expression RIGHT_BRACKET_SYM 
-	  | deref_operation )*
+	  | deref_operation[$result]>[$result] )*
 	;
 
 value_expression_primary>[Item *result] :
@@ -1646,7 +1709,14 @@
 	;
 
 mysql_var_reference :
-	  AT_SYMBOL ( AT_SYMBOL opt_var_ident_type[OPT_DEFAULT] ident_or_text opt_component | ident_or_text ( SET_VAR value_expression | ) )
+	  AT_SYMBOL 
+	  ( AT_SYMBOL opt_var_ident_type[OPT_DEFAULT] 
+	    ident_or_text opt_component 
+	  | ident_or_text 
+	    ( SET_VAR value_expression 
+	    | /* empty */
+	    ) 
+	  )
 	;
 
 opt_var_ident_type[enum enum_var_type def]>[enum enum_var_type result] :
@@ -1664,7 +1734,7 @@
 comparison_predicate[Item *lhs]>[Item *result] :
 	  <<chooser_compare_func_creator op;>>
 	  comp_op>[op] 
-	  ( quantified_comparison_predicate 
+	  ( quantifier subquery
 	  | value_expression>[$result]
 	    <<$result= op(0)->create($lhs, $result);>> 
 	  )
@@ -1687,11 +1757,10 @@
 	;
 
 sql_parameter_reference>[String *result] :
-	  ( <<String ident;>>
-	    regular_identifier>[ident]
-	    <<$result= new String(ident);>>
-	  | delimited_identifier>[$result]
-	  )
+	  (REGULAR_IDENT|DELIMITED_IDENT)?=><<isSQLParameterName(LT(1))>>?[
+	    failedSemanticPredicate("<sql parameter name> expected");
+	  ]
+	  actual_identifier>[$result]
 	  ( PERIOD identifier )*
 	;
 
@@ -1711,10 +1780,12 @@
 	  identifier ( PERIOD identifier )*
 	;
 
-deref_operation :
-	  PERIOD ( direct_invocation | field_reference )
-	| attribute_or_method_reference
-	| array_concat_constructor
+deref_operation[Item *item]>[Item *result] :
+	  PERIOD 
+	  ( direct_invocation[$item]>[$result] 
+	  | field_reference[$item]>[$result] )
+	| attribute_or_method_reference[$item]>[$result]
+	| array_concat_constructor[$item]>[$result]
 	;
 
 unsigned_literal>[Item *result] :
@@ -1728,13 +1799,16 @@
 	;
 
 set_function_specification :
-	  COUNT LEFT_PAREN { set_quantifier } ( ASTERISK RIGHT_PAREN | value_expression RIGHT_PAREN )
+	  COUNT LEFT_PAREN { set_quantifier } 
+	  ( ASTERISK RIGHT_PAREN 
+	  | value_expression RIGHT_PAREN )
 	| general_set_function
 	| grouping_operation
 	;
 
 general_set_function :
-	  set_function_type LEFT_PAREN { set_quantifier } value_expression RIGHT_PAREN
+	  set_function_type LEFT_PAREN { set_quantifier } 
+	  value_expression RIGHT_PAREN
 	;
 
 set_function_type :
@@ -1777,15 +1851,17 @@
 	;
 
 with_list_element :
-	  query_name { LEFT_PAREN with_column_list RIGHT_PAREN } AS LEFT_PAREN query_expression RIGHT_PAREN search_or_cycle_clause
+	  actual_identifier /*query_name*/ 
+	  { LEFT_PAREN with_column_list RIGHT_PAREN } 
+	  AS LEFT_PAREN query_expression RIGHT_PAREN 
+	  search_or_cycle_clause
 	;
 
 query_name>[String *result] :
-	  ( <<String ident;>>
-	    regular_identifier>[ident]
-	    <<$result= new String(ident);>>
-	  )
-	| delimited_identifier
+	  (REGULAR_IDENT|DELIMITED_IDENT)?=><<isQueryName(LT(1))>>?[
+	    failedSemanticPredicate("<query name> expected");
+	  ]
+	  actual_identifier>[$result]
 	;
 
 with_column_list :
@@ -1827,7 +1903,11 @@
 	;
 
 cycle_clause :
-	  CYCLE cycle_column_list SET cycle_mark_column TO cycle_mark_value DEFAULT non_cycle_mark_value USING path_column
+	  CYCLE cycle_column_list 
+	  SET cycle_mark_column 
+	  TO cycle_mark_value 
+	  DEFAULT non_cycle_mark_value 
+	  USING path_column
 	;
 
 cycle_column_list :
@@ -1871,7 +1951,14 @@
 	;
 
 non_join_query_expression :
-	  ( non_join_query_term | joined_table union_except_query_term ) ( union_except_query_term )*
+	  ( ( joined_union_except_query_term )?
+	    joined_union_except_query_term
+	  | non_join_query_term )
+	  ( union_except_query_term )*
+	;
+
+joined_union_except_query_term :
+	  joined_table union_except_query_term
 	;
 
 union_except_query_term :
@@ -1884,7 +1971,14 @@
 	;
 
 non_join_query_term :
-	  ( joined_table intersect_query_term | non_join_query_primary ) ( intersect_query_term )*
+	  ( ( joined_intersect_query_term )?
+	    joined_intersect_query_term 
+	  | non_join_query_primary ) 
+	  ( intersect_query_term )*
+	;
+
+joined_intersect_query_term :
+	  joined_table intersect_query_term
 	;
 
 intersect_query_term :
@@ -1909,7 +2003,7 @@
 	;
 
 query_specification :
-	  SELECT { set_quantifier } select_list table_expression
+	  SELECT { set_quantifier } select_list { table_expression }
 	;
 
 select_list :
@@ -1931,28 +2025,24 @@
 	;
 
 qualified_asterisk :
-	  ( asterisked_identifier_chain )? asterisked_identifier_chain ASTERISK
-	| all_fields_reference
-	;
-
-asterisked_identifier_chain :
-	  ( asterisked_identifier PERIOD )+
-	;
-
-asterisked_identifier>[String *result] :
-	  identifier>[$result]
-	;
-
-all_fields_reference :
-	  value_expression_primary PERIOD ASTERISK
+	  table_name PERIOD ASTERISK
 	;
 
 table_expression :
-	  from_clause { where_clause } { group_by_clause } { having_clause } { order_by_clause } { limit_clause }
+	  from_clause 
+	  { where_clause } 
+	  { group_by_clause } 
+	  { having_clause } 
+	  { order_by_clause } 
+	  { limit_clause }
 	;
 
 limit_clause :
-	  LIMIT numeric_value_expression ( OFFSET numeric_value_expression | COMMA numeric_value_expression | )
+	  LIMIT numeric_value_expression 
+	  ( OFFSET numeric_value_expression 
+	  | COMMA numeric_value_expression 
+	  | /* empty */
+	  )
 	;
 
 from_clause :
@@ -2001,7 +2091,8 @@
 	;
 
 collection_derived_table :
-	  UNNEST LEFT_PAREN collection_value_expression RIGHT_PAREN { WITH ORDINALITY }
+	  UNNEST LEFT_PAREN collection_value_expression RIGHT_PAREN 
+	  { WITH ORDINALITY }
 	;
 
 collection_value_expression :
@@ -2156,8 +2247,10 @@
 	;
 
 case_abbreviation :
-	  NULLIF LEFT_PAREN value_expression COMMA value_expression RIGHT_PAREN
-	| COALESCE LEFT_PAREN value_expression value_expression_list RIGHT_PAREN
+	  NULLIF LEFT_PAREN value_expression 
+	  COMMA value_expression RIGHT_PAREN
+	| COALESCE LEFT_PAREN value_expression 
+	  value_expression_list RIGHT_PAREN
 	;
 
 case_specification :
@@ -2208,16 +2301,12 @@
 	;
 
 target_data_type :
-	  user_defined_type
+	  ( user_defined_type )? user_defined_type
 	| data_type
 	;
 
-attribute_or_method_reference :
-	  dereference_operator qualified_identifier { sql_argument_list }
-	;
-
-dereference_operator :
-	  RIGHT_ARROW
+attribute_or_method_reference[Item *item]>[Item *result] :
+	  RIGHT_ARROW qualified_identifier { sql_argument_list }
 	;
 
 sql_argument_list :
@@ -2230,7 +2319,7 @@
 	;
 
 target_specification :
-	  ( sql_parameter_reference )? sql_parameter_reference
+	  sql_parameter_reference
 	| column_reference
 	;
 
@@ -2243,7 +2332,8 @@
 	;
 
 array_value_expression :
-	  array_value_constructor ( CONCAT_OPERATOR array_value_component )*
+	  array_value_constructor 
+	  ( CONCAT_OPERATOR array_value_component )*
 	;
 
 array_value_component :
@@ -2252,7 +2342,7 @@
 	| LEFT_PAREN value_expression RIGHT_PAREN
 	;
 
-array_concat_constructor :
+array_concat_constructor[Item *item]>[Item *result] :
 	  ( CONCAT_OPERATOR array_value_component )+
 	;
 
@@ -2277,14 +2367,15 @@
 	;
 
 routine_name :
-	  { schema_name PERIOD } qualified_identifier
+	  { (schema_name PERIOD)? schema_name PERIOD } 
+	  qualified_identifier
 	;
-
-field_reference :
+	
+field_reference[Item *item]>[Item *result] :
 	  field_name
 	;
 
-direct_invocation :
+direct_invocation[Item *item]>[Item *result] :
 	  method_name { sql_argument_list }
 	;
 
@@ -2306,11 +2397,14 @@
 	;
 
 position_expression>[Item *result] :
-	  POSITION LEFT_PAREN string_value_expression IN string_value_expression RIGHT_PAREN
+	  POSITION LEFT_PAREN string_value_expression 
+	  IN string_value_expression RIGHT_PAREN
 	;
 
 string_value_function>[Item *result] :
-	  SUBSTRING LEFT_PAREN character_value_expression FROM character_substring_function { FOR numeric_value_expression }
+	  SUBSTRING LEFT_PAREN character_value_expression 
+	  FROM character_substring_function 
+	  { FOR numeric_value_expression }
 	| TRIM LEFT_PAREN trim_operands RIGHT_PAREN
 	| OVERLAY LEFT_PAREN overlay_function
 	| fold>[$result]
@@ -2319,19 +2413,25 @@
 	;
 
 overlay_function>[Item *result] :
-	  character_value_expression PLACING character_value_expression FROM numeric_value_expression { FOR numeric_value_expression } RIGHT_PAREN
+	  character_value_expression 
+	  PLACING character_value_expression 
+	  FROM numeric_value_expression 
+	  { FOR numeric_value_expression } RIGHT_PAREN
 	;
 
 character_substring_function>[Item *result] :
-	  numeric_value_expression { FOR numeric_value_expression } RIGHT_PAREN
+	  numeric_value_expression 
+	  { FOR numeric_value_expression } RIGHT_PAREN
 	;
 
 fold>[Item *result] :
-	  ( UPPER | LOWER ) LEFT_PAREN character_value_expression RIGHT_PAREN
+	  ( UPPER | LOWER ) 
+	  LEFT_PAREN character_value_expression RIGHT_PAREN
 	;
 
 form_of_use_conversion>[Item *result] :
-	  CONVERT LEFT_PAREN character_value_expression USING form_of_use_conversion_name RIGHT_PAREN
+	  CONVERT LEFT_PAREN character_value_expression 
+	  USING form_of_use_conversion_name RIGHT_PAREN
 	;
 
 form_of_use_conversion_name :
@@ -2339,7 +2439,8 @@
 	;
 
 character_translation>[Item *result] :
-	  TRANSLATE LEFT_PAREN character_value_expression USING translation_name RIGHT_PAREN
+	  TRANSLATE LEFT_PAREN character_value_expression 
+	  USING translation_name RIGHT_PAREN
 	;
 
 translation_name :
@@ -2347,7 +2448,8 @@
 	;
 
 trim_operands :
-	  { trim_specification } character_value_expression { FROM character_value_expression }
+	  { trim_specification } character_value_expression 
+	  { FROM character_value_expression }
 	;
 
 trim_specification :
@@ -2365,7 +2467,8 @@
 	;
 
 extract_expression>[Item *result] :
-	  EXTRACT LEFT_PAREN extract_field FROM extract_source RIGHT_PAREN
+	  EXTRACT LEFT_PAREN extract_field 
+	  FROM extract_source RIGHT_PAREN
 	;
 
 extract_field :
@@ -2424,7 +2527,10 @@
 	;
 
 modulus_expression>[Item *result] :
-	  MOD LEFT_PAREN numeric_value_expression COMMA numeric_value_expression RIGHT_PAREN
+	  <<Item *v1,*v2;>>
+	  MOD LEFT_PAREN numeric_value_expression>[v1] 
+	  COMMA numeric_value_expression>[v2] RIGHT_PAREN
+	  <<$result= new Item_func_mod(v1,v2);>>
 	;
 
 row_value_constructor>[Item *result] :
@@ -2448,33 +2554,53 @@
 	| GT_EQ_OPERATOR	<<$result= &comp_ge_creator;>>
 	;
 
-between_predicate :
-	  BETWEEN { ASYMMETRIC | SYMMETRIC } simple_value_expression AND simple_value_expression
-	;
-
-in_predicate :
-	  IN LEFT_PAREN ( query_expression RIGHT_PAREN | in_value_list RIGHT_PAREN )
+between_predicate[bool isnot,Item *lhs]>[Item *result] :
+	  <<Item *v1,*v2;>>
+	  BETWEEN { ASYMMETRIC | SYMMETRIC } 
+	  simple_value_expression>[v1] AND simple_value_expression>[v2]
+	  <<
+	    $result= new Item_func_between($lhs,v1,v2);
+	    if (isnot) $result= new Item_func_not($result);
+	  >>
 	;
 
-in_value_list :
-	  value_expression ( COMMA value_expression )*
+in_predicate[bool isnot,Item *lhs]>[Item *result] :
+	  IN LEFT_PAREN 
+	  ( query_expression RIGHT_PAREN 
+	  | ( <<List<Item> list;Item *item;>>
+	      value_expression>[item] 
+	      ( COMMA <<list.push_back(item);>> 
+	        value_expression>[item] 
+	      )*
+	      <<
+	        list.push_back(item);
+		list.push_front(lhs);
+		$result= new Item_func_in(list);
+	      >>
+	    ) 
+	  )
+	  <<if (isnot) $result= new Item_func_not($result);>>
 	;
 
-like_predicate :
-	  LIKE character_value_expression { ESCAPE escape_character }
-	| SOUNDS LIKE character_value_expression
+like_predicate[bool isnot,Item *lhs]>[Item *result] :
+	  LIKE character_value_expression>[$result] 
+	  { ESCAPE escape_character }
+	  <<
+	    $result= new Item_func_like($lhs,$result,NULL);
+	    if (isnot) $result= new Item_func_not($result);
+	  >>
+	| SOUNDS LIKE character_value_expression>[$result]
+	  <<$result= comp_eq_creator(isnot)->create($lhs,$result);>>
 	;
 
 escape_character :
 	  character_value_expression
 	;
 
-null_predicate :
+null_predicate[bool isnot,Item *lhs]>[Item *result] :
 	  NULL_SYM
-	;
-
-quantified_comparison_predicate :
-	  quantifier subquery
+	  <<$result= isnot ? (Item*)new Item_func_isnotnull($lhs)
+	  		   : (Item*)new Item_func_isnull($lhs);>>
 	;
 
 quantifier>[int result] :
@@ -2482,32 +2608,32 @@
 	| ( SOME | ANY )	<<$result=0;>>
 	;
 
-exists_predicate :
+exists_predicate>[Item *result] :
 	  EXISTS subquery
 	;
 
-unique_predicate :
+unique_predicate>[Item *result] :
 	  UNIQUE subquery
 	;
 
-match_predicate :
+match_predicate[Item *lhs]>[Item *result] :
 	  MATCH { UNIQUE } { SIMPLE | PARTIAL | FULL } subquery
 	;
 
-overlaps_predicate :
+overlaps_predicate[Item *lhs]>[Item *result] :
 	  OVERLAPS value_expression
 	;
 
-similar_predicate :
+similar_predicate[bool isnot,Item *lhs]>[Item *result] :
 	  SIMILAR TO character_value_expression 
 	  { ESCAPE character_value_expression }
 	;
 
-distinct_predicate :
+distinct_predicate[Item *lhs]>[Item *result] :
 	  DISTINCT FROM value_expression
 	;
 
-type_predicate :
+type_predicate[bool isnot,Item *lhs]>[Item *result] :
 	  OF LEFT_PAREN type_list RIGHT_PAREN
 	;
 
@@ -2529,8 +2655,14 @@
 	;
 
 constraint_characteristics :
-	  constraint_check_time { { NOT } DEFERRABLE }
-	| { NOT } DEFERRABLE { constraint_check_time }
+	  constraint_check_time 
+	  { (constraint_deferrable)? constraint_deferrable }
+	| constraint_deferrable { constraint_check_time }
+	;
+	
+constraint_deferrable : 
+	  DEFERRABLE
+	| NOT DEFERRABLE
 	;
 
 constraint_check_time :
@@ -2538,7 +2670,9 @@
 	;
 
 table_constraint_definition :
-	  { constraint_name_definition } table_constraint { constraint_characteristics }
+	  { constraint_name_definition } 
+	  table_constraint 
+	  { constraint_characteristics }
 	;
 
 table_constraint :
@@ -2548,7 +2682,9 @@
 	;
 
 unique_constraint_definition :
-	  UNIQUE LEFT_PAREN ( VALUE RIGHT_PAREN | unique_column_list RIGHT_PAREN )
+	  UNIQUE LEFT_PAREN 
+	  ( VALUE RIGHT_PAREN 
+	  | unique_column_list RIGHT_PAREN )
 	| PRIMARY KEY_SYM LEFT_PAREN unique_column_list RIGHT_PAREN
 	;
 
@@ -2557,7 +2693,8 @@
 	;
 
 referential_constraint_definition :
-	  FOREIGN KEY_SYM LEFT_PAREN referencing_columns RIGHT_PAREN references_specification
+	  FOREIGN KEY_SYM LEFT_PAREN referencing_columns 
+	  RIGHT_PAREN references_specification
 	;
 
 referencing_columns :
@@ -2587,7 +2724,10 @@
 	;
 
 column_option_list :
-	  { scope_clause } { default_clause } ( column_constraint_definition )* { collate_clause }
+	  { scope_clause } 
+	  { default_clause } 
+	  ( column_constraint_definition )* 
+	  { collate_clause }
 	;
 
 table_commit_action :
@@ -2600,11 +2740,8 @@
 	;
 
 local_qualified_name :
-	  { local_qualifier PERIOD } qualified_identifier
-	;
-
-local_qualifier :
-	  MODULE
+	  MODULE PERIOD qualified_identifier
+	| qualified_identifier
 	;
 
 locator_indication :
@@ -2626,7 +2763,12 @@
 	;
 
 sql_set_statement :
-	  SET ( set_transaction_statement | set_constraints_mode_statement | set_connection_statement | set_session_statement )
+	  SET 
+	  ( set_transaction_statement 
+	  | set_constraints_mode_statement 
+	  | set_connection_statement 
+	  | set_session_statement 
+	  )
 	;
 
 sql_schema_statement :
@@ -2635,12 +2777,32 @@
 	;
 
 sql_schema_definition_statement :
-	  CREATE ( schema_definition | table_definition | view_definition | sql_invoked_routine | role_definition | domain_definition | character_set_definition | collation_definition | translation_definition | assertion_definition | trigger_definition | user_defined_type_definition | user_defined_cast_definition | user_defined_ordering_definition | transform_definition )
-	| GRANT ( grant_privilege_statement | grant_role_statement )
+	  CREATE 
+	  ( schema_definition 
+	  | table_definition 
+	  | view_definition 
+	  | sql_invoked_routine 
+	  | role_definition 
+	  | domain_definition 
+	  | character_set_definition 
+	  | collation_definition 
+	  | translation_definition 
+	  | assertion_definition 
+	  | trigger_definition 
+	  | user_defined_type_definition 
+	  | user_defined_cast_definition 
+	  | user_defined_ordering_definition 
+	  | transform_definition 
+	  )
+	| GRANT 
+	  ( grant_privilege_statement 
+	  | grant_role_statement )
 	;
 
 schema_definition :
-	  SCHEMA schema_name_clause { schema_character_set_or_path } ( schema_element )*
+	  SCHEMA schema_name_clause 
+	  { schema_character_set_or_path } 
+	  ( schema_element )*
 	;
 
 schema_name_clause :
@@ -2666,12 +2828,29 @@
 	;
 
 schema_element :
-	  CREATE ( table_definition | view_definition | domain_definition | character_set_definition | collation_definition | translation_definition | assertion_definition | trigger_definition | user_defined_type_definition | schema_routine | role_definition )
-	| GRANT ( grant_privilege_statement | grant_role_statement )
+	  CREATE 
+	  ( table_definition 
+	  | view_definition 
+	  | domain_definition 
+	  | character_set_definition 
+	  | collation_definition 
+	  | translation_definition 
+	  | assertion_definition 
+	  | trigger_definition 
+	  | user_defined_type_definition 
+	  | schema_routine 
+	  | role_definition 
+	  )
+	| GRANT 
+	  ( grant_privilege_statement 
+	  | grant_role_statement 
+	  )
 	;
 
 table_definition :
-	  { table_scope } TABLE_SYM table_name table_contents_source { ON COMMIT table_commit_action ROWS }
+	  { table_scope } TABLE_SYM table_name 
+	  table_contents_source 
+	  { ON COMMIT table_commit_action ROWS }
 	;
 
 table_scope :
@@ -2685,7 +2864,8 @@
 
 table_contents_source :
 	  table_element_list
-	| OF user_defined_type { subtable_clause } { table_element_list }
+	| OF user_defined_type { subtable_clause } 
+	  { table_element_list }
 	;
 
 subtable_clause :
@@ -2701,7 +2881,9 @@
 	;
 
 view_definition :
-	  { RECURSIVE } VIEW table_name view_specification AS query_expression { WITH { levels_clause } CHECK OPTION }
+	  { RECURSIVE } VIEW table_name 
+	  view_specification AS query_expression 
+	  { WITH { levels_clause } CHECK OPTION }
 	;
 
 view_specification :
@@ -2726,7 +2908,9 @@
 	;
 
 view_element_list :
-	  LEFT_PAREN { self_referencing_column_specification COMMA } view_element ( COMMA view_element )* RIGHT_PAREN
+	  LEFT_PAREN 
+	  { self_referencing_column_specification COMMA } 
+	  view_element ( COMMA view_element )* RIGHT_PAREN
 	;
 
 view_element :
@@ -2743,15 +2927,21 @@
 	;
 
 domain_definition :
-	  DOMAIN_SYM domain_name { AS } data_type { default_clause } ( domain_constraint )* { collate_clause }
+	  DOMAIN_SYM domain_name { AS } data_type 
+	  { default_clause } 
+	  ( domain_constraint )* 
+	  { collate_clause }
 	;
 
 domain_constraint :
-	  { constraint_name_definition } check_constraint_definition { constraint_characteristics }
+	  { constraint_name_definition } 
+	  check_constraint_definition 
+	  { constraint_characteristics }
 	;
 
 character_set_definition :
-	  CHARACTER SET character_set_name { AS } character_set_source { collate_clause }
+	  CHARACTER SET character_set_name 
+	  { AS } character_set_source { collate_clause }
 	;
 
 character_set_source :
@@ -2759,7 +2949,10 @@
 	;
 
 collation_definition :
-	  COLLATION collation_name FOR character_set_specification FROM existing_collation_name { pad_characteristic }
+	  COLLATION collation_name 
+	  FOR character_set_specification 
+	  FROM existing_collation_name 
+	  { pad_characteristic }
 	;
 
 existing_collation_name :
@@ -2772,7 +2965,10 @@
 	;
 
 translation_definition :
-	  TRANSLATION translation_name FOR source_character_set_specification TO target_character_set_specification FROM translation_source
+	  TRANSLATION translation_name 
+	  FOR source_character_set_specification 
+	  TO target_character_set_specification 
+	  FROM translation_source
 	;
 
 source_character_set_specification :
@@ -2825,11 +3021,17 @@
 	;
 
 assertion_definition :
-	  ASSERTION constraint_name CHECK LEFT_PAREN search_condition RIGHT_PAREN { constraint_characteristics }
+	  ASSERTION constraint_name CHECK 
+	  LEFT_PAREN search_condition RIGHT_PAREN 
+	  { constraint_characteristics }
 	;
 
 trigger_definition :
-	  TRIGGER trigger_name trigger_action_time trigger_event ON table_name { REFERENCING old_or_new_values_alias_list } triggered_action
+	  TRIGGER trigger_name 
+	  trigger_action_time trigger_event 
+	  ON table_name 
+	  { REFERENCING old_or_new_values_alias_list } 
+	  triggered_action
 	;
 
 trigger_name :
@@ -2861,7 +3063,9 @@
 	;
 
 triggered_action :
-	  { FOR EACH ( ROW | STATEMENT ) } { WHEN LEFT_PAREN search_condition RIGHT_PAREN } triggered_sql_statement
+	  { FOR EACH ( ROW | STATEMENT ) } 
+	  { WHEN LEFT_PAREN search_condition RIGHT_PAREN } 
+	  triggered_sql_statement
 	;
 
 triggered_sql_statement :
@@ -2874,7 +3078,11 @@
 	;
 
 user_defined_type_body :
-	  user_defined_type_name { subtype_clause } { AS representation } { instantiable_clause } finality { reference_type_specification } cast_option { method_specification_list }
+	  user_defined_type_name { subtype_clause } 
+	  { AS representation } 
+	  { (instantiable_clause)? instantiable_clause } 
+	  finality { reference_type_specification } 
+	  cast_option { method_specification_list }
 	;
 
 subtype_clause :
@@ -2899,7 +3107,8 @@
 	;
 
 attribute_definition :
-	  attribute_name data_type { reference_scope_check } { attribute_default } { collate_clause }
+	  attribute_name data_type { reference_scope_check } 
+	  { attribute_default } { collate_clause }
 	;
 
 attribute_name>[String *result] :
@@ -2921,7 +3130,11 @@
 	;
 
 reference_type_specification :
-	  REF ( user_defined_representation | derived_representation | system_generated_representation )
+	  REF 
+	  ( user_defined_representation 
+	  | derived_representation 
+	  | system_generated_representation 
+	  )
 	;
 
 user_defined_representation :
@@ -2929,7 +3142,13 @@
 	;
 
 ref_cast_option :
-	  { ( CAST LEFT_PAREN ( REF | SOURCE ) )? CAST LEFT_PAREN ( cast_to_ref { ( CAST LEFT_PAREN REF )? CAST LEFT_PAREN cast_to_type } | cast_to_type ) }
+	  { ( CAST LEFT_PAREN ( REF | SOURCE ) )? 
+	    CAST LEFT_PAREN 
+	    ( cast_to_ref 
+	      { ( CAST LEFT_PAREN REF )? CAST LEFT_PAREN cast_to_type } 
+	    | cast_to_type 
+	    ) 
+	  }
 	;
 
 cast_to_ref :
@@ -2961,7 +3180,11 @@
 	;
 
 cast_option :
-	  { CAST LEFT_PAREN ( cast_to_distinct { CAST LEFT_PAREN cast_to_source } | cast_to_source ) }
+	  { CAST LEFT_PAREN 
+	    ( cast_to_distinct { CAST LEFT_PAREN cast_to_source } 
+	    | cast_to_source 
+	    ) 
+	  }
 	;
 
 cast_to_distinct :
@@ -2990,19 +3213,32 @@
 	;
 
 original_method_specification :
-	  partial_method_specification { SELF AS ( RESULT { SELF AS LOCATOR } | LOCATOR ) } { method_characteristics }
+	  partial_method_specification 
+	  { SELF AS ( RESULT { SELF AS LOCATOR } | LOCATOR ) } 
+	  { method_characteristics }
 	;
 
 partial_method_specification :
-	  { INSTANCE | STATIC } METHOD method_name sql_parameter_declaration_list returns_clause { SPECIFIC specific_name }
+	  { INSTANCE | STATIC } METHOD method_name 
+	  sql_parameter_declaration_list returns_clause 
+	  { SPECIFIC specific_name }
 	;
 
 sql_parameter_declaration_list :
-	  LEFT_PAREN { sql_parameter_declaration ( COMMA sql_parameter_declaration )* } RIGHT_PAREN
+	  LEFT_PAREN 
+	  { sql_parameter_declaration 
+	    ( COMMA sql_parameter_declaration )* 
+	  } 
+	  RIGHT_PAREN
 	;
 
 sql_parameter_declaration :
-	  { parameter_mode } ( ( sql_parameter_name parameter_type )? sql_parameter_name parameter_type | parameter_type ) { RESULT }
+	  { parameter_mode } 
+	  ( ( sql_parameter_name parameter_type )? 
+	    sql_parameter_name parameter_type 
+	  | parameter_type 
+	  ) 
+	  { RESULT }
 	;
 
 parameter_mode :
@@ -3088,7 +3324,9 @@
 	;
 
 sql_invoked_procedure :
-	  PROCEDURE schema_qualified_routine_name sql_parameter_declaration_list routine_characteristics routine_body
+	  PROCEDURE schema_qualified_routine_name 
+	  sql_parameter_declaration_list 
+	  routine_characteristics routine_body
 	;
 
 routine_characteristics :
@@ -3115,8 +3353,8 @@
 	;
 
 routine_body :
-	  sql_routine_body
-	| external_body_reference
+	  external_body_reference
+	| sql_routine_body
 	;
 
 sql_routine_body :
@@ -3124,7 +3362,9 @@
 	;
 
 external_body_reference :
-	  EXTERNAL { NAME external_routine_name } { parameter_style_clause } { external_security_clause }
+	  EXTERNAL { NAME external_routine_name } 
+	  { parameter_style_clause } 
+	  { external_security_clause }
 	;
 
 external_routine_name>[String *result] :
@@ -3144,11 +3384,17 @@
 	;
 
 sql_invoked_function :
-	  ( function_specification | method_specification_designator ) routine_body
+	  ( function_specification 
+	  | method_specification_designator 
+	  ) 
+	  routine_body
 	;
 
 function_specification :
-	  FUNCTION schema_qualified_routine_name sql_parameter_declaration_list returns_clause routine_characteristics { dispatch_clause }
+	  FUNCTION schema_qualified_routine_name 
+	  sql_parameter_declaration_list 
+	  returns_clause routine_characteristics 
+	  { dispatch_clause }
 	;
 
 dispatch_clause :
@@ -3156,11 +3402,19 @@
 	;
 
 method_specification_designator :
-	  { INSTANCE | STATIC } METHOD method_name sql_parameter_declaration_list { returns_clause } FOR user_defined_type
+	  { INSTANCE | STATIC } METHOD method_name 
+	  sql_parameter_declaration_list { returns_clause } 
+	  FOR user_defined_type
 	;
 
 grant_privilege_statement :
-	  privileges TO grantee ( COMMA grantee )* { WITH ( HIERARCHY OPTION { WITH GRANT OPTION } | GRANT OPTION ) } { GRANTED BY grantor }
+	  privileges TO grantee ( COMMA grantee )* 
+	  { WITH 
+	    ( HIERARCHY OPTION { WITH GRANT OPTION } 
+	    | GRANT OPTION 
+	    ) 
+	  } 
+	  { GRANTED BY grantor }
 	;
 
 privileges :
@@ -3173,7 +3427,12 @@
 	;
 
 action :
-	  SELECT { LEFT_PAREN ( privilege_column_list | privilege_method_list ) RIGHT_PAREN }
+	  SELECT 
+	  { LEFT_PAREN 
+	    ( privilege_method_list 
+	    | privilege_column_list ) 
+	    RIGHT_PAREN 
+	  }
 	| DELETE
 	| INSERT { LEFT_PAREN privilege_column_list RIGHT_PAREN }
 	| UPDATE { LEFT_PAREN privilege_column_list RIGHT_PAREN }
@@ -3189,17 +3448,18 @@
 	;
 
 privilege_method_list :
-	  specific_routine_designator ( COMMA specific_routine_designator )*
+	  specific_routine_designator 
+	  ( COMMA specific_routine_designator )*
 	;
 
 object_name :
-	  { TABLE_SYM } table_name
-	| DOMAIN_SYM domain_name
+	  DOMAIN_SYM domain_name
 	| COLLATION collation_name
 	| CHARACTER SET character_set_name
 	| TRANSLATION translation_name
 	| TYPE user_defined_type_name
 	| specific_routine_designator
+	| { TABLE_SYM } table_name
 	;
 
 grantee :
@@ -3213,7 +3473,10 @@
 	;
 
 grant_role_statement :
-	  role_granted ( COMMA role_granted )* TO grantee ( COMMA grantee )* { WITH ADMIN OPTION } { GRANTED BY grantor }
+	  role_granted ( COMMA role_granted )* 
+	  TO grantee ( COMMA grantee )* 
+	  { WITH ADMIN OPTION } 
+	  { GRANTED BY grantor }
 	;
 
 role_granted :
@@ -3229,7 +3492,9 @@
 	;
 
 user_defined_cast_definition :
-	  CAST LEFT_PAREN source_data_type AS target_data_type RIGHT_PAREN WITH cast_function { AS ASSIGNMENT }
+	  CAST LEFT_PAREN source_data_type 
+	  AS target_data_type RIGHT_PAREN 
+	  WITH cast_function { AS ASSIGNMENT }
 	;
 
 source_data_type :
@@ -3317,8 +3582,29 @@
 	;
 
 sql_schema_manipulation_statement :
-	  ALTER ( alter_table_statement | alter_routine_statement | alter_domain_statement | alter_type_statement )
-	| DROP ( drop_schema_statement | drop_table_statement | drop_view_statement | drop_routine_statement | drop_user_defined_cast_statement | drop_role_statement | drop_domain_statement | drop_character_set_statement | drop_collation_statement | drop_translation_statement | drop_assertion_statement | drop_trigger_statement | drop_data_type_statement | drop_user_defined_ordering_statement | drop_transform_statement )
+	  ALTER 
+	  ( alter_table_statement 
+	  | alter_routine_statement 
+	  | alter_domain_statement 
+	  | alter_type_statement 
+	  )
+	| DROP 
+	  ( drop_schema_statement 
+	  | drop_table_statement 
+	  | drop_view_statement 
+	  | drop_routine_statement 
+	  | drop_user_defined_cast_statement 
+	  | drop_role_statement 
+	  | drop_domain_statement 
+	  | drop_character_set_statement 
+	  | drop_collation_statement 
+	  | drop_translation_statement 
+	  | drop_assertion_statement 
+	  | drop_trigger_statement 
+	  | drop_data_type_statement 
+	  | drop_user_defined_ordering_statement 
+	  | drop_transform_statement 
+	  )
 	| revoke_statement
 	;
 
@@ -3336,9 +3622,15 @@
 	;
 
 alter_table_action :
-	  ADD ( add_column_definition | add_table_constraint_definition )
+	  ADD 
+	  ( add_column_definition 
+	  | add_table_constraint_definition 
+	  )
 	| alter_column_definition
-	| DROP ( drop_column_definition | drop_table_constraint_definition )
+	| DROP 
+	  ( drop_column_definition 
+	  | drop_table_constraint_definition 
+	  )
 	;
 
 add_column_definition :
@@ -3352,7 +3644,10 @@
 alter_column_action :
 	  set_column_default_clause
 	| add_column_scope_clause
-	| DROP ( drop_column_default_clause | drop_column_scope_clause )
+	| DROP 
+	  ( drop_column_default_clause 
+	  | drop_column_scope_clause 
+	  )
 	;
 
 set_column_default_clause :
@@ -3392,7 +3687,9 @@
 	;
 
 alter_routine_statement :
-	  specific_routine_designator alter_routine_characteristics alter_routine_behaviour
+	  specific_routine_designator 
+	  alter_routine_characteristics 
+	  alter_routine_behaviour
 	;
 
 alter_routine_characteristics :
@@ -3417,15 +3714,21 @@
 	;
 
 drop_user_defined_cast_statement :
-	  CAST LEFT_PAREN source_data_type AS target_data_type RIGHT_PAREN drop_behavior
+	  CAST LEFT_PAREN source_data_type 
+	  AS target_data_type RIGHT_PAREN drop_behavior
 	;
 
 revoke_statement :
-	  REVOKE ( revoke_privilege_statement | revoke_role_statement )
+	  REVOKE 
+	  ( revoke_privilege_statement 
+	  | revoke_role_statement 
+	  )
 	;
 
 revoke_privilege_statement :
-	  { revoke_option_extension } privileges FROM grantee ( COMMA grantee )* { GRANTED BY grantor } drop_behavior
+	  { revoke_option_extension } privileges 
+	  FROM grantee ( COMMA grantee )* 
+	  { GRANTED BY grantor } drop_behavior
 	;
 
 revoke_option_extension :
@@ -3434,7 +3737,9 @@
 	;
 
 revoke_role_statement :
-	  { ADMIN OPTION FOR } role_revoked ( COMMA role_revoked )* FROM grantee ( COMMA grantee )* { GRANTED BY grantor } drop_behavior
+	  { ADMIN OPTION FOR } role_revoked ( COMMA role_revoked )* 
+	  FROM grantee ( COMMA grantee )* 
+	  { GRANTED BY grantor } drop_behavior
 	;
 
 role_revoked :
@@ -3452,7 +3757,10 @@
 alter_domain_action :
 	  set_domain_default_clause
 	| add_domain_constraint_definition
-	| DROP ( drop_domain_default_clause | drop_domain_constraint_definition )
+	| DROP 
+	  ( drop_domain_default_clause 
+	  | drop_domain_constraint_definition 
+	  )
 	;
 
 set_domain_default_clause :
@@ -3500,8 +3808,15 @@
 	;
 
 alter_type_action :
-	  ADD ( add_attribute_definition | add_original_method_specification | add_overriding_method_specification )
-	| DROP ( drop_attribute_definition | drop_method_specification )
+	  ADD 
+	  ( add_attribute_definition 
+	  | add_original_method_specification 
+	  | add_overriding_method_specification 
+	  )
+	| DROP 
+	  ( drop_attribute_definition 
+	  | drop_method_specification 
+	  )
 	;
 
 add_attribute_definition :
@@ -3533,7 +3848,8 @@
 	;
 
 drop_transform_statement :
-	  TRANSFORM_SYM transforms_to_be_dropped FOR user_defined_type drop_behavior
+	  TRANSFORM_SYM transforms_to_be_dropped 
+	  FOR user_defined_type drop_behavior
 	;
 
 transforms_to_be_dropped :
@@ -3558,7 +3874,8 @@
 	;
 
 fetch_statement :
-	  FETCH { { fetch_orientation } FROM } cursor_name INTO fetch_target_list
+	  FETCH { { fetch_orientation } FROM } cursor_name 
+	  INTO fetch_target_list
 	;
 
 fetch_orientation :
@@ -3570,7 +3887,7 @@
 	;
 
 simple_value_specification>[Item *result] :
-	  ( sql_parameter_reference )? sql_parameter_reference
+	  sql_parameter_reference
 	| literal>[$result]
 	;
 
@@ -3598,7 +3915,9 @@
 
 	
 select_statement_single_row :
-	  SELECT { set_quantifier } select_list into_clause { table_expression } 
+	  SELECT { set_quantifier } 
+	  select_list into_clause 
+	  { table_expression } 
 	;
 
 into_clause :
@@ -3610,9 +3929,13 @@
 	;
 
 sql_data_change_statement :
-	  DELETE FROM target_table WHERE ( ( WHERE CURRENT )? delete_statement_positioned | delete_statement_searched )
+	  DELETE FROM target_table 
+	  ( ( WHERE CURRENT )? delete_statement_positioned 
+	  | delete_statement_searched )
 	| insert_statement
-	| UPDATE target_table SET set_clause_list ( ( WHERE CURRENT )? update_statement_positioned | update_statement_searched )
+	| UPDATE target_table SET set_clause_list 
+	  ( ( WHERE CURRENT )? update_statement_positioned 
+	  | update_statement_searched )
 	;
 
 delete_statement_positioned :
@@ -3636,7 +3959,9 @@
 	;
 
 insert_columns_and_source :
-	  { LEFT_PAREN insert_column_list RIGHT_PAREN } { override_clause } ( from_constructor | from_subquery )
+	  { LEFT_PAREN insert_column_list RIGHT_PAREN } 
+	  { override_clause } 
+	  ( from_constructor | from_subquery )
 	| from_default
 	;
 
@@ -3661,7 +3986,8 @@
 	;
 
 contextually_typed_row_value_expression_list :
-	  contextually_typed_row_value_expression ( COMMA contextually_typed_row_value_expression )*
+	  contextually_typed_row_value_expression 
+	  ( COMMA contextually_typed_row_value_expression )*
 	;
 
 contextually_typed_row_value_expression>[Item *result] :
@@ -3670,9 +3996,12 @@
 	;
 
 contextually_typed_row_value_constructor :
-	  ROW LEFT_PAREN contextually_typed_row_value_constructor_element_list RIGHT_PAREN
+	  ROW LEFT_PAREN 
+	  contextually_typed_row_value_constructor_element_list RIGHT_PAREN
 	| contextually_typed_value_specification
-	| LEFT_PAREN contextually_typed_row_value_constructor_element_list RIGHT_PAREN
+	| LEFT_PAREN 
+	  contextually_typed_row_value_constructor_element_list 
+	  RIGHT_PAREN
 	;
 
 contextually_typed_row_value_constructor_element>[Item *result] :
@@ -3690,7 +4019,8 @@
 	;
 
 contextually_typed_row_value_constructor_element_list :
-	  contextually_typed_row_value_constructor_element ( COMMA contextually_typed_row_value_constructor_element )*
+	  contextually_typed_row_value_constructor_element 
+	  ( COMMA contextually_typed_row_value_constructor_element )*
 	;
 
 from_default :
@@ -3706,7 +4036,8 @@
 	;
 
 set_clause :
-	  ( update_target EQ_OPERATOR )? update_target EQ_OPERATOR update_source
+	  ( update_target EQ_OPERATOR )? 
+	  update_target EQ_OPERATOR update_source
 	| mutated_set_clause EQ_OPERATOR update_source
 	;
 
@@ -3745,9 +4076,9 @@
 	  RETURN return_value
 	;
 
-return_value :
-	  null_specification
-	| value_expression
+return_value>[Item *result] :
+	  null_specification>[$result]
+	| value_expression>[$result]
 	;
 
 sql_transaction_statement :
@@ -3759,7 +4090,8 @@
 	;
 
 start_transaction_statement :
-	  START_SYM TRANSACTION transaction_mode ( COMMA transaction_mode )*
+	  START_SYM TRANSACTION 
+	  transaction_mode ( COMMA transaction_mode )*
 	;
 
 transaction_mode :
@@ -3886,7 +4218,12 @@
 	;
 
 set_session_statement :
-	  ( SESSION ( set_session_user_identifier_statement | set_session_characteristics_statement ) | set_role_statement | set_local_time_zone_statement )
+	  SESSION 
+	  ( set_session_user_identifier_statement 
+	  | set_session_characteristics_statement 
+	  ) 
+	| set_role_statement 
+	| set_local_time_zone_statement 
 	;
 
 set_session_user_identifier_statement :
@@ -3941,7 +4278,8 @@
 	;
 
 statement_information_item :
-	  simple_target_specification EQ_OPERATOR statement_information_item_name
+	  simple_target_specification 
+	  EQ_OPERATOR statement_information_item_name
 	;
 
 statement_information_item_name>[String result] :
@@ -3950,7 +4288,8 @@
 	;
 
 condition_information :
-	  EXCEPTION condition_number condition_information_item ( COMMA condition_information_item )*
+	  EXCEPTION condition_number condition_information_item 
+	  ( COMMA condition_information_item )*
 	;
 
 condition_number :
@@ -3958,7 +4297,8 @@
 	;
 
 condition_information_item :
-	  simple_target_specification EQ_OPERATOR condition_information_item_name
+	  simple_target_specification 
+	  EQ_OPERATOR condition_information_item_name
 	;
 
 condition_information_item_name>[String result] :
@@ -3993,6 +4333,17 @@
 	  >>
 	;
 
+integer_numeric_literal>[Item_int *result] :
+	  num:UNSIGNED_INTEGER
+	  <<
+	    String st= $num->getString();
+	    ulonglong v= $num->lexdata.ullvalue;
+	    $result = (v > INT_MAX)
+	    ? new Item_uint(st.ptr(),st.length())
+	    : new Item_int(st.ptr(), (longlong)v, st.length());
+	  >>
+	;
+	
 exact_numeric_literal>[Item_real *result] :
 	  num:EXACT_NUM_LITERAL
 	  <<
@@ -4077,17 +4428,26 @@
 	    >> )*
 	;
 
-bit_string_literal :
-	  BIT_CHAR_STRING ( BIT_CHAR_PART )*
+bit_string_literal>[Item_bitbinary *result] :
+	  <<String st;>>
+	  bs:BIT_CHAR_STRING 
+	  <<st= $bs->getString();>>
+	  ( bp:BIT_CHAR_PART 
+	    <<
+	      String part= $bp->getString();
+	      st.append(part);
+	    >>
+	  )*
+	  <<$result= new Item_bitbinary(st.ptr(), st.length());>>
 	;
 
 hex_string_literal>[Item_varbinary *result] :
 	  <<String st;>>
 	  hs:HEX_CHAR_STRING 
-	  <<st= hs->getString();>>
+	  <<st= $hs->getString();>>
 	  ( hp:HEX_CHAR_PART 
 	    <<
-	      String part= hp->getString();
+	      String part= $hp->getString();
 	      st.append(part);
 	    >>
 	  )*
Thread
bk commit into 5.0 tree (antony:1.1666)Antony T Curtis22 Mar