summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-6153 Trivial Lintian errors in MariaDB sources: spelling errors and ↵Sergei Golubchik2014-05-131-1/+1
| | | | wrong executable bits
* MDEV-5314 - Compiling fails on OSX using clangSergey Vojtovich2014-02-191-2/+2
| | | | | | | | | | | | | This is port of fix for MySQL BUG#17647863. revno: 5572 revision-id: jon.hauglid@oracle.com-20131030232243-b0pw98oy72uka2sj committer: Jon Olav Hauglid <jon.hauglid@oracle.com> timestamp: Thu 2013-10-31 00:22:43 +0100 message: Bug#17647863: MYSQL DOES NOT COMPILE ON OSX 10.9 GM Rename test() macro to MY_TEST() to avoid conflict with libc++.
* 10.0-base mergeSergei Golubchik2014-02-031-1/+1
|\
| * 5.5 mergeSergei Golubchik2014-02-011-1/+1
| |\
| | * MySQL-5.5.35 mergeSergei Golubchik2014-01-221-1/+1
| | |\
| | | * Bug#16346241 - SERVER CRASH IN ITEM_PARAM::QUERY_VAL_STRNeeraj Bisht2013-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem:- Second execution of prepared statement for query with parameter in limit clause, causes an assert when using connectors (e.g., Connector C). Analysis:- In prepared statement, LIMIT parameters can be specified using '?' markers. Value for the parameter can be supplied while executing the prepared statement. Passing string, float or double values for LIMIT clause works well from command-line client. That's because, while setting the LIMIT parameter value from a user-variable, the value is converted to integer value. However, when prepared statement is executed from other interfaces as J connectors, or C applications etc, the value for the parameters are sent to the server with execute command. Each item in command has value and the data TYPE. So, while setting parameter values from this log, value is set to all the parameters with the same data type as passed. Here, we have the logic to convert the value to change the state and item_type if it is part of LIMIT parameter and its item_type is not INT. But when we reset this parameter we save the item_type but change state. So on second execution we have old item_type but our state has been changed, which make us to use string type variable in Item_param::query_str_val(). This cause an assert. Fix: Instead of checking the item_type of the parameter, check for the state of the parameter. As state value are reset everytime we execute the statement.
* | | | 10.0-base mergeSergei Golubchik2013-12-161-2/+19
|\ \ \ \ | |/ / /
| * | | 5.5 mergeSergei Golubchik2013-11-231-2/+19
| |\ \ \ | | |/ /
| | * | mysql-5.5.34 mergeSergei Golubchik2013-11-191-2/+19
| | |\ \ | | | |/ | | | | | | | | (some patches reverted, test case added)
| | | * Fix for bug#14188793 - "DEADLOCK CAUSED BY ALTER TABLE DOEN'T CLEARDmitry Lenev2013-08-201-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STATUS OF ROLLBACKED TRANSACTION" and bug #17054007 - "TRANSACTION IS NOT FULLY ROLLED BACK IN CASE OF INNODB DEADLOCK". The problem in the first bug report was that although deadlock involving metadata locks was reported using the same error code and message as InnoDB deadlock it didn't rollback transaction like the latter. This caused confusion to users as in some cases after ER_LOCK_DEADLOCK transaction could have been restarted immediately and in some cases rollback was required. The problem in the second bug report was that although InnoDB deadlock caused transaction rollback in all storage engines it didn't cause release of metadata locks. So concurrent DDL on the tables used in transaction was blocked until implicit or explicit COMMIT or ROLLBACK was issued in the connection which got InnoDB deadlock. The former issue has stemmed from the fact that when support for detection and reporting metadata locks deadlocks was added we erroneously assumed that InnoDB doesn't rollback transaction on deadlock but only last statement (while this is what happens on InnoDB lock timeout actually) and so didn't implement rollback of transactions on MDL deadlocks. The latter issue was caused by the fact that rollback of transaction due to deadlock is carried out by setting THD::transaction_rollback_request flag at the point where deadlock is detected and performing rollback inside of trans_rollback_stmt() call when this flag is set. And trans_rollback_stmt() is not aware of MDL locks, so no MDL locks are released. This patch solves these two problems in the following way: - In case when MDL deadlock is detect transaction rollback is requested by setting THD::transaction_rollback_request flag. - Code performing rollback of transaction if THD::transaction_rollback_request is moved out from trans_rollback_stmt(). Now we handle rollback request on the same level as we call trans_rollback_stmt() and release statement/ transaction MDL locks.
* | | | 10.0-base mergeSergei Golubchik2013-11-131-4/+4
|\ \ \ \ | |/ / /
| * | | 5.5. mergeSergei Golubchik2013-11-131-4/+4
| |\ \ \ | | |/ /
| | * | MDEV-4824 userstats - wrong user statisticsSergei Golubchik2013-11-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (and valgrind warnings) * move thd userstat initialization to the same function that was adding thd userstat to global counters. * initialize thd->start_bytes_received in THD::init (when thd->userstat_running is set)
* | | | merge 10.0-base -> 10.0unknown2013-10-291-1/+7
|\ \ \ \ | |/ / /
| * | | merge 5.5->10.0-baseunknown2013-10-291-1/+7
| |\ \ \ | | |/ /
| | * | Merge 5.3->5.5unknown2013-10-291-1/+7
| | |\ \
| | | * | MDEV-5143: update of a joined table with a nested subquery with a syntax ↵unknown2013-10-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | error crashes mysqld with signal 11 Added check of SELECT_LEX::handle_derived() result.
* | | | | merge 10.0-base -> 10.0unknown2013-10-171-0/+6
|\ \ \ \ \ | |/ / / /
| * | | | Merge 5.5 -> 10.0-baseAlexander Barkov2013-10-161-0/+6
| |\ \ \ \ | | |/ / /
| | * | | MDEV-4981: Account for queries handled by query-cache in USER_STATISTICS ↵unknown2013-10-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (and in HOST_STATISTICS) fix for SP & PS
* | | | | Merge 10.0-base -> 10.0Sergey Petrunya2013-10-161-0/+16
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-5117: Explain for a query executed as a PS is not written into the slow logSergey Petrunya2013-10-151-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | - Save the query plan after the statement was executed so that its gets into the slow query log.
| * | | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-051-3/+3
| | | | | | | | | | | | | | | | | | | | - Address review feedback: rename nearly any name used by the new EXPLAIN code.
| * | | | [SHOW] EXPLAIN UPDATE/DELETE, code re-structuringSergey Petrunya2013-08-241-0/+3
| |\ \ \ \ | | | | | | | | | | | | | | | | | | - Merge with current 10.0-base
| | * \ \ \ [SHOW] EXPLAIN UPDATE/DELETE, code re-structuringSergey Petrunya2013-06-271-0/+3
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Merge with 10.0-base
| | | * | | | [SHOW] EXPLAIN UPDATE/DELETE, code re-structuringSergey Petrunya2013-06-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Handle statements inside SPs: = regular statements = SET command, which does not have its own statement. - Handle execution of subquery from range optimizer: allocate subquery QPFs on the same MEM_ROOT as the whole query plan was allocated.
| | | * | | | [SHOW] EXPLAIN UPDATE/DELETE, code re-structuringSergey Petrunya2013-06-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Introduce back QueryPlan/QueryPlanFootprint separation for single-table UPDATEs/DELETEs - Create an empty QueryPlanFootprint for all kinds of queries
* | | | | | | 10.0-base merge.Sergei Golubchik2013-09-211-1/+4
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
| * | | | | | MergeIgor Babaev2013-08-061-1/+4
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| | * | | | | MWL#205 DELETE with result set (mdev-3814)Igor Babaev2013-08-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Includes all post-review fixes as well.
* | | | | | | cosmetic fixesSergei Golubchik2013-07-211-1/+1
| | | | | | |
* | | | | | | 10.0-monty mergeSergei Golubchik2013-07-211-44/+69
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | includes: * remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING" * introduce LOCK_share, now LOCK_ha_data is strictly for engines * rea_create_table() always creates .par file (even in "frm-only" mode) * fix a 5.6 bug, temp file leak on dummy ALTER TABLE
| * | | | | | | merge of 2876.430.11 & 2876.430.1unknown2013-06-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CF_PREOPEN_TMP_TABLES & CF_HA_CLOSE & Patch for Bug#11746602 (27480: Extend CREATE TEMPORARY TABLES privilege to allow temp table operations).
| * | | | | | | A fix of unions with duplicate rows and returning bug fix for lp:732124 ↵unknown2013-06-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | union + limit returns wrong result
| * | | | | | | Fixed some memory leaksMichael Widenius2013-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disabled some asserts that we can't yet have enabled
| * | | | | | | Finished merging wl5986 started by Igor.unknown2013-06-191-2/+2
| | | | | | | |
| * | | | | | | Fixed some merge issues:Michael Widenius2013-06-181-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - temporary tables now works - mysql-system_tables updated to not use temporary tables - PASSWORD() function fixed - Support for STATS_AUTO_RECALC, STATS_PERSISTENT and STATS_SAMPLE_PAGES table options
| * | | | | | | More merge fixes:Michael Widenius2013-06-161-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - mdl.cc and mdl.h merged completely - mysql_system_tables*.sql merged completely - Fixed wrong merge of lock_tables - Added some missing functions: - bool THD::notify_shared_lock() - Dynamic_array::pop, Dynamic_array::del - Added MDL_context_owner to THD - Added metadata_locks_hash_instances
| * | | | | | | Fixed patch that was part of last push that didn't apply correctly.Michael Widenius2013-06-151-10/+7
| | | | | | | |
| * | | | | | | Applied all changes from Igor and SanjaMichael Widenius2013-06-151-24/+20
| | | | | | | |
| * | | | | | | Temporary commit of 10.0-mergeMichael Widenius2013-03-261-1/+1
| | | | | | | |
* | | | | | | | 10.0-base mergeSergei Golubchik2013-07-181-0/+1
|\ \ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | |
| * | | | | | | MDEV-4660 SHUTDOWN commandSergei Golubchik2013-06-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on James Briggs contribution.
* | | | | | | | Adding support for MySQL-5.6 temporal column types:Alexander Barkov2013-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TIME, DATETIME, TIMESTAMP added: mysql-test/r/type_temporal_mysql56.result mysql-test/std_data/mysql56datetime.MYD mysql-test/std_data/mysql56datetime.MYI mysql-test/std_data/mysql56datetime.frm mysql-test/std_data/mysql56time.MYD mysql-test/std_data/mysql56time.MYI mysql-test/std_data/mysql56time.frm mysql-test/std_data/mysql56timestamp.MYD mysql-test/std_data/mysql56timestamp.MYI mysql-test/std_data/mysql56timestamp.frm mysql-test/suite/rpl/r/rpl_temporal_mysql56.result mysql-test/suite/rpl/t/rpl_temporal_mysql56.test mysql-test/t/type_temporal_mysql56.test sql/compat56.cc sql/compat56.h modified: client/mysqlbinlog.cc include/my_time.h include/mysql.h.pp include/mysql_com.h mysql-test/r/statistics.result mysql-test/r/strict.result mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result sql-common/my_time.c sql/CMakeLists.txt sql/field.cc sql/field.h sql/item.cc sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/log_event.cc sql/opt_range.cc sql/opt_table_elimination.cc sql/protocol.cc sql/rpl_utility.cc sql/rpl_utility.h sql/sql_partition.cc sql/sql_prepare.cc sql/sql_select.cc sql/sql_table.cc sql/table.cc storage/perfschema/pfs_engine_table.cc
* | | | | | | | 10.0-base mergeSergei Golubchik2013-06-061-4/+5
|\ \ \ \ \ \ \ \ | |/ / / / / / / | | / / / / / / | |/ / / / / / |/| | | | | | (without InnoDB - all InnoDB changes were ignored)
| * | | | | | 5.5 mergeSergei Golubchik2013-06-061-4/+5
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | / / / | | | |/ / / | | |/| | |
| | * | | | 5.3 merge.Sergei Golubchik2013-05-201-1/+1
| | |\ \ \ \ | | | | |/ / | | | |/| | | | | | | | change maria.distinct to use a function that doesn't require ssl-enabled builds
| | | * | | 5.2 mergeSergei Golubchik2013-05-201-1/+1
| | | |\ \ \
| | | | * \ \ 5.1 mergeSergei Golubchik2013-05-201-1/+1
| | | | |\ \ \
| | | | | * | | MDEV-4326 fix.unknown2013-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed "optimization" which caused preoblems on second execution of PS with string parameter in LIMIT clause. Fixed test_bug43560 to be able to skipp it if connection is UNIX socket.