let's leave "INSERT ... SELECT ... UPDATE" for the future

This commit is contained in:
unknown 2002-11-29 16:17:52 +01:00
parent 8e02b39abd
commit 1d418357ed

View file

@ -682,7 +682,7 @@ query:
{
send_error(thd,ER_EMPTY_QUERY);
YYABORT;
}
}
else
{
thd->lex.sql_command = SQLCOM_EMPTY_QUERY;
@ -810,7 +810,7 @@ create:
LEX *lex=Lex;
lex->sql_command= SQLCOM_CREATE_TABLE;
if (!lex->select_lex.add_table_to_list($5,
($2 &
($2 &
HA_LEX_CREATE_TMP_TABLE ?
&tmp_table_alias :
(LEX_STRING*) 0),1,
@ -1073,7 +1073,7 @@ type:
$$=FIELD_TYPE_STRING; }
| char opt_binary { Lex->length=(char*) "1";
$$=FIELD_TYPE_STRING; }
| BINARY '(' NUM ')' { Lex->length=$3.str;
| BINARY '(' NUM ')' { Lex->length=$3.str;
Lex->charset=my_charset_bin;
$$=FIELD_TYPE_STRING; }
| varchar '(' NUM ')' opt_binary { Lex->length=$3.str;
@ -1373,7 +1373,7 @@ alter:
lex->alter_list.empty();
lex->select_lex.init_order();
lex->select_lex.db=lex->name=0;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
bzero((char*) &lex->create_info,sizeof(lex->create_info));
lex->create_info.db_type= DB_TYPE_DEFAULT;
lex->create_info.table_charset=thd->db_charset?thd->db_charset:default_charset_info;
lex->create_info.row_type= ROW_TYPE_NOT_USED;
@ -1622,7 +1622,7 @@ table_to_table:
if (!sl->add_table_to_list($1,NULL,1,TL_IGNORE) ||
!sl->add_table_to_list($3,NULL,1,TL_IGNORE))
YYABORT;
};
};
/*
Select : retrieve data from table
@ -1636,7 +1636,7 @@ select:
select_init:
SELECT_SYM select_init2
|
'(' SELECT_SYM select_part2 ')'
'(' SELECT_SYM select_part2 ')'
{
LEX *lex= Lex;
SELECT_LEX_NODE * sel= lex->current_select;
@ -1647,7 +1647,7 @@ select_init:
}
/* select in braces, can't contain global parameters */
sel->master_unit()->global_parameters=
sel->master_unit();
sel->master_unit();
} union_opt;
select_init2:
@ -3039,13 +3039,22 @@ values:
;
expr_or_default:
expr { $$= $1;}
expr { $$= $1;}
| DEFAULT {$$= new Item_default(); }
;
opt_insert_update:
/* empty */
| ON DUPLICATE KEY_SYM UPDATE_SYM SET update_list
{ /* for simplisity, let's forget about
INSERT ... SELECT ... UPDATE
for a moment */
if (Lex->sql_command != SQLCOM_INSERT)
{
send_error(Lex->thd, ER_SYNTAX_ERROR);
YYABORT;
}
}
;
/* Update rows in a table */