diff options
author | bell@sanja.is.com.ua <> | 2004-04-08 00:16:17 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2004-04-08 00:16:17 +0300 |
commit | 5e37c41faee13cdc977842d253e6da0266766baf (patch) | |
tree | fd9a8f8f063a77fbde120e4c655eda322010feeb /sql/sql_update.cc | |
parent | 75e7ca479e52e14358df0b70c35e6c604c6bca72 (diff) | |
download | mariadb-git-5e37c41faee13cdc977842d253e6da0266766baf.tar.gz |
new error for unsupported command in PS
fixed IN subselect with basic constant left expression
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
unchecked commands now is rejected by PS protocol to avoid serever crash
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 1a9906be0cc..c7c87a488fd 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -99,7 +99,7 @@ int mysql_update(THD *thd, setup_conds(thd,update_table_list,&conds) || thd->lex->select_lex.setup_ref_array(thd, order_num) || setup_order(thd, thd->lex->select_lex.ref_pointer_array, - &tables, all_fields, all_fields, order) || + update_table_list, all_fields, all_fields, order) || setup_ftfuncs(&thd->lex->select_lex)) DBUG_RETURN(-1); /* purecov: inspected */ @@ -427,6 +427,9 @@ int mysql_multi_update(THD *thd, int res; multi_update *result; TABLE_LIST *tl; + TABLE_LIST *update_list= + (TABLE_LIST*)thd->lex->select_lex.table_list.first; + table_map item_tables= 0, derived_tables= 0; DBUG_ENTER("mysql_multi_update"); @@ -439,7 +442,7 @@ int mysql_multi_update(THD *thd, Ensure that we have update privilege for all tables and columns in the SET part */ - for (tl= table_list ; tl ; tl=tl->next) + for (tl= update_list; tl; tl= tl->next) { TABLE *table= tl->table; /* @@ -456,14 +459,14 @@ int mysql_multi_update(THD *thd, { // Assign table map values to check updatability of derived tables uint tablenr=0; - for (TABLE_LIST *table_list= (TABLE_LIST*) select_lex->table_list.first; + for (TABLE_LIST *table_list= update_list; table_list; table_list= table_list->next, tablenr++) { table_list->table->map= (table_map) 1 << tablenr; } } - if (setup_fields(thd, 0, table_list, *fields, 1, 0, 0)) + if (setup_fields(thd, 0, update_list, *fields, 1, 0, 0)) DBUG_RETURN(-1); if (thd->lex->derived_tables) { @@ -479,7 +482,7 @@ int mysql_multi_update(THD *thd, /* Count tables and setup timestamp handling */ - for (tl= select_lex->get_table_list() ; tl ; tl= tl->next) + for (tl= update_list; tl; tl= tl->next) { TABLE *table= tl->table; @@ -496,7 +499,7 @@ int mysql_multi_update(THD *thd, if (thd->lex->derived_tables && (item_tables & derived_tables)) { // find derived table which cause error - for (tl= select_lex->get_table_list() ; tl ; tl= tl->next) + for (tl= update_list; tl; tl= tl->next) { if (tl->derived && (item_tables & tl->table->map)) { |