summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
Commit message (Collapse)AuthorAgeFilesLines
* A fix for Bug#44495 "Prepared Statement: CALL p(<x>) - `thd->protocol == ↵Konstantin Osipov2009-07-151-18/+25
| | | | | | | | | | | | | | &thd->protocol_text' failed" Do not assume that SQL prepared statements always run in text protocol. When invoked from a stored procedure, which is itself invoked by means of prepared CALL statement, the protocol may be binary. Juggle with the protocol only when we want to change it to binary in COM_STMT_EXECUTE, COM_STMT_PREPARE. This is a backport from 5.4/6.0, where the bug was fixed as part of WL#4264 "Backup: Stabilize Service Interface"
*-. Merge from 5.0-bugteamStaale Smedseng2009-06-171-8/+7
|\ \
| | * Bug #43414 Parenthesis (and other) warnings compiling MySQL Staale Smedseng2009-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the second patch, fixing more of the warnings.
| * | Bug #43414 Parenthesis (and other) warnings compiling MySQL Staale Smedseng2009-06-101-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the second patch, fixing more of the warnings.
| * Pull 5.1 treatment of community features into 5.0.Chad MILLER2009-05-051-1/+1
| |
| * Merge 5.0.80 release and 5.0 community. Version left at 5.0.80.Chad MILLER2009-04-141-4/+4
| |\
| * \ Merged from 5.0 (enterprise).Chad MILLER2008-12-171-3/+4
| |\ \
| * \ \ Merge from 5.0 trunk.Chad MILLER2008-07-141-3/+3
| |\ \ \
| * \ \ \ Merge chunk from trunk.Chad MILLER2008-07-101-7/+50
| |\ \ \ \
| * \ \ \ \ Merge bk-internal.mysql.com:/home/bk/mysql-5.0cmiller@zippy.cornsilk.net2007-12-101-0/+3
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
| | * \ \ \ \ Merge bk-internal.mysql.com:/home/bk/mysql-5.0cmiller@zippy.cornsilk.net2007-09-101-0/+3
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
| | | * \ \ \ \ Merge mysqldev@production.mysql.com:my/mysql-5.0-releasecmiller@zippy.cornsilk.net2007-07-021-0/+3
| | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
| | | | * \ \ \ \ Merge mysqldev@production.mysql.com:my/mysql-5.0-releasecmiller@zippy.cornsilk.net2007-04-261-0/+3
| | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
* | | | | \ \ \ \ \ Merge bug#45326Magnus Blåudd2009-06-051-22/+22
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | Bug#45326 Linker failure for libmysqld with VC++ 2008Magnus Blåudd2009-06-051-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Rename the functions in mysqld that conflict with the one in the external interface defined by mysql.h
* | | | | | | | | | | Recommit of bug 43560 after merge with mysql-5.1-bugteamStaale Smedseng2009-05-201-0/+3
|/ / / / / / / / / /
* | | | | | | | | | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-131-4/+4
|\ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
| * | | | | | | | | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-101-4/+4
| | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
* | | | | | | | | Bug#35577, manual merge mysql-5.0-bugteam -> mysql-5.1-bugteamMarc Alff2008-07-141-3/+3
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / /
| * | | | | | | | Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending onMarc Alff2008-07-141-3/+4
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | build) The crash was caused by freeing the internal parser stack during the parser execution. This occured only for complex stored procedures, after reallocating the parser stack using my_yyoverflow(), with the following C call stack: - MYSQLparse() - any rule calling sp_head::restore_lex() - lex_end() - x_free(lex->yacc_yyss), xfree(lex->yacc_yyvs) The root cause is the implementation of stored procedures, which breaks the assumption from 4.1 that there is only one LEX structure per parser call. The solution is to separate the LEX structure into: - attributes that represent a statement (the current LEX structure), - attributes that relate to the syntax parser itself (Yacc_state), so that parsing multiple statements in stored programs can create multiple LEX structures while not changing the unique Yacc_state. Now, Yacc_state and the existing Lex_input_stream are aggregated into Parser_state, a structure that represent the complete state of the (Lexical + Syntax) parser.
| * | | | | | | Merge host.loc:/home/uchum/work/mysql-5.0gshchepa/uchum@host.loc2008-03-271-3/+3
| |\ \ \ \ \ \ \ | | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | into host.loc:/home/uchum/work/5.0-opt
| * | | | | | | Post-merge fix for Bug 35103.davi@mysql.com/endora.local2008-03-171-1/+1
| | | | | | | |
| * | | | | | | Bug#35103 mysql_client_test::test_bug29948 causes sporadic failuresdavi@mysql.com/endora.local2008-03-141-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that the COM_STMT_SEND_LONG_DATA was sending a response packet if the prepared statement wasn't found in the server (due to reconnection). The commands COM_STMT_SEND_LONG_DATA and COM_STMT_CLOSE should not send any packets, even error packets should not be sent since they are not expected by the client API. The solution is to clear generated during the execution of the aforementioned commands and to skip resend of prepared statement commands. Another fix is that if the connection breaks during the send of prepared statement command, the command is not sent again since the prepared statement is no longer in the server.
* | | | | | | | A fix for Konstantin Osipov2008-07-031-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#12093 "SP not found on second PS execution if another thread drops other SP in between" and Bug#21294 "executing a prepared statement that executes a stored function which was recreat" Stored functions are resolved at prepared statement prepare only. If someone flushes the stored functions cache between prepare and execute, execution fails. The fix is to detect the situation of the cache flush and automatically reprepare the prepared statement after it.
* | | | | | | | Bug#31210: INSERT DELAYED crashes server when used on partitioned tablesMattias Jonsson2008-06-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | post push patch push build found tree failing test when using: --ps-protocol --mysqld=--binlog-format=row Changed to the new error message.
* | | | | | | | Bug#27430 "Crash in subquery code when in PS and table DDL changed afterkostja@bodhi.(none)2008-05-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PREPARE", review fixes: - make the patch follow the specification of WL#4166 and remove the new error that was originally introduced. Now the client never gets an error from reprepare, unless it failed. I.e. even if the statement at hand returns a completely different result set, this is not considered a server error. The C API library, that can not handle this situation, was modified to return a client error. Added additional test coverage.
* | | | | | | | Bug#27430 "Crash in subquery code when in PS and table DDL changed after kostja@bodhi.(none)2008-05-201-37/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PREPARE": rename members, methods, classes to follow the spec (a code review request)
* | | | | | | | Fix mysql_client_test failure in pushbuild 5.1-27430kostja@bodhi.(none)2008-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Bug#27430)
* | | | | | | | Implement some code review fixes for the fix for Bug#27430 kostja@bodhi.(none)2008-05-181-46/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Crash in subquery code when in PS and table DDL changed after PREPARE"
* | | | | | | | WL#4165 "Prepared statements: validation".kostja@bodhi.(none)2008-04-171-2/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add metadata validation to ~20 more SQL commands. Make sure that these commands actually work in ps-protocol, since until now they were enabled, but not carefully tested. Fixes the ml003 bug found by Matthias during internal testing of the patch.
* | | | | | | | Fix pushbuild errors and warnings.kostja@dipika.(none)2008-04-081-6/+2
| | | | | | | |
* | | | | | | | Tentative implementation ofkostja@dipika.(none)2008-04-081-84/+432
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WL#4165 Prepared statements: validation WL#4166 Prepared statements: automatic re-prepare Fixes Bug#27430 Crash in subquery code when in PS and table DDL changed after PREPARE Bug#27690 Re-execution of prepared statement after table was replaced with a view crashes Bug#27420 A combination of PS and view operations cause error + assertion on shutdown The basic idea of the patch is to keep track of table metadata between prepared statement prepare and execute. If some table used in the statement has changed, the prepared statement is re-prepared before execution. See WL#4165 and WL#4166 contents and comments in the code for details of the implementation.
* | | | | | | | Merge mysql.com:/Users/davi/mysql/bugs/ps-cleanup-5.1davi@endora.local2008-03-311-33/+40
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/Users/davi/mysql/mysql-5.1-runtime
| * | | | | | | | Post-merge fixes for bug 35103davi@mysql.com/endora.local2008-03-251-33/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't signal errors for the COM_STMT_SEND_LONG_DATA and COM_STMT_CLOSE commands.
* | | | | | | | | Merge host.loc:/home/uchum/work/mysql-5.1gshchepa/uchum@host.loc2008-03-271-3/+3
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | | | | | | | | | | into host.loc:/home/uchum/work/5.1-opt
| * | | | | | | | Merge magare.gmz:/home/kgeorge/mysql/autopush/B26461-5.0-optgkodinov/kgeorge@magare.gmz2008-03-211-3/+3
| |\ \ \ \ \ \ \ \ | | | |/ / / / / / | | |/| | | | | | | | | | | | | | | into magare.gmz:/home/kgeorge/mysql/work/B26461-5.1-opt
| | * | | | | | | Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes)gkodinov/kgeorge@macbook.gmz2008-03-211-3/+3
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bool data type was redefined to BOOL (4 bytes on windows). Removed the #define and fixed some of the warnings that were uncovered by this. Note that the fix also disables 2 warnings : 4800 : 'type' : forcing value to bool 'true' or 'false' (performance warning) 4805: 'operation' : unsafe mix of type 'type' and type 'type' in operation These warnings will be handled in a separate bug, as they are performance related or bogus. Fixed to int the return type of functions that return more than 2 distinct values.
* | | | | | | | Post-merge fixes for Bug 35103davi@buzz.(none)2008-03-171-2/+2
|/ / / / / / /
* | | | | | | Bug#28386 the general log is incompletedavi@mysql.com/endora.local2008-02-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the commands COM_STMT_CLOSE, COM_STMT_RESET, COM_STMT_SEND_LONG_DATA weren't being logged to the general log. The solution is to log the general log the aforementioned commands.
* | | | | | | Merge buzz.(none):/home/davi/mysql-5.0-runtimedavi@buzz.(none)2008-02-211-0/+39
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | into buzz.(none):/home/davi/mysql-5.1-runtime
| * | | | | | Post-merge fix to silence compiler warning.davi@buzz.(none)2008-02-211-1/+0
| | | | | | |
| * | | | | | Bug#32890 Crash after repeated create and drop of tables and viewsdavi@mysql.com/endora.local2008-02-211-0/+40
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that CREATE VIEW statements inside prepared statements weren't being expanded during the prepare phase, which leads to objects not being allocated in the appropriate memory arenas. The solution is to perform the validation of CREATE VIEW statements during the prepare phase of a prepared statement. The validation during the prepare phase assures that transformations of the parsed tree will use the permanent arena of the prepared statement.
* | | | | | Rename send_eof() to my_eof() for consistency with my_ok() and my_error()kostja@dipika.(none)2008-02-191-1/+1
| | | | | |
* | | | | | Rename send_ok to my_ok. Similarly to my_error, it only records the status,kostja@dipika.(none)2008-02-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | does not send it to the client.
* | | | | | Merge quad.:/mnt/raid/alik/MySQL/devel/5.1anozdrin/alik@quad.2008-02-011-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
| * | | | | | A fix and a test case for Bug#34166 Server crash in SHOW OPEN TABLES andkostja@dipika.(none)2008-01-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pre-locking. The crash was caused by an implicit assumption in check_table_access() that table_list parameter is always a part of lex->query_tables. When iterating over the passed list of tables, check_table_access() used to stop only when lex->query_tables_last_not_own was reached. In case of pre-locking, lex->query_tables_last_own is not NULL and points to some element of lex->query_tables. When the parameter of check_table_access() was not part of lex->query_tables, loop invariant could never be violated and a crash would happen when the current table pointer would point beyond the end of the provided list. The fix is to change the signature of check_table_access() to also accept a numeric limit of loop iterations, similarly to check_grant(), and supply this limit in all places when we want to check access of tables that are outside lex->query_tables, or just want to check access to one table.
* | | | | | | Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maintserg@janus.mylan2007-12-201-10/+17
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | into janus.mylan:/usr/home/serg/Abk/mysql-5.1
| * | | | | | Bug#12713 "Error in a stored function called from a SELECT doesn't kostja@bodhi.(none)2007-12-121-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cause ROLLBACK of statement", part 1. Review fixes. Do not send OK/EOF packets to the client until we reached the end of the current statement. This is a consolidation, to keep the functionality that is shared by all SQL statements in one place in the server. Currently this functionality includes: - close_thread_tables() - log_slow_statement(). After this patch and the subsequent patch for Bug#12713, it shall also include: - ha_autocommit_or_rollback() - net_end_statement() - query_cache_end_of_result(). In future it may also include: - mysql_reset_thd_for_next_command().
* | | | | | | Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-forcollapseandmergecmiller@zippy.cornsilk.net2007-12-141-313/+289
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
| * \ \ \ \ \ \ Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maintcmiller@zippy.cornsilk.net2007-12-141-312/+288
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint