diff options
author | monty@mysql.com <> | 2004-10-26 19:30:01 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2004-10-26 19:30:01 +0300 |
commit | 6fbc869d183b777576670f37edaa293f16c1fa68 (patch) | |
tree | 355a805ce6da2de5e852c4f9b8372d612070cd6d /sql/sql_prepare.cc | |
parent | 8b6839e6446fde2931583d4d8b74bb531add5062 (diff) | |
download | mariadb-git-6fbc869d183b777576670f37edaa293f16c1fa68.tar.gz |
A lot of fixes for prepared statements (PS):
New mysqltest that can run mysqltest with PS
Added support for ZEROFILL in PS
Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result()
Updated test cases to support --ps-protocol
(Some tests are still run using old protocol)
Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2...
Fixed crash in PS when using sub queries
Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries)
Fix for PS and SELECT ... PROCEDURE
Reset all warnings when executing a new PS query
group_concat(...ORDER BY) didn't work with PS
Fixed problem with test suite when not using innodb
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 0e939498925..5a311eefacd 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1093,7 +1093,14 @@ static int mysql_test_select(Prepared_statement *stmt, } else { - List<Item> &fields= lex->select_lex.item_list; + /* Make copy of item list, as change_columns may change it */ + List<Item> fields(lex->select_lex.item_list); + + /* Change columns if a procedure like analyse() */ + if (unit->last_procedure && + unit->last_procedure->change_columns(fields)) + goto err_prep; + /* We can use lex->result as it should've been prepared in unit->prepare call above. @@ -1596,6 +1603,8 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, thd->current_arena= stmt; mysql_init_query(thd, (uchar *) thd->query, thd->query_length); + /* Reset warnings from previous command */ + mysql_reset_errors(thd); lex= thd->lex; lex->safe_to_cache_query= 0; |