summaryrefslogtreecommitdiff
path: root/mysql-test/r
Commit message (Collapse)AuthorAgeFilesLines
* Bug#49193 CREATE TABLE reacts differently depending on whether Magne Mahre2010-05-051-0/+41
| | | | | | | | | data is selected or not Temporary and permanent tables should live in different namespaces. In this case, resolving a permanent table name gave the temporary table, resulting in a name collision.
* Bug#48800 CREATE TABLE t...SELECT fails if t is a temporaryMagne Mahre2010-05-051-0/+15
| | | | | | | | | | | | | | table If a temporary table A exists, and a (permanent) table with the same name is attempted created with "CREATE TABLE ... AS SELECT", the create would fail with an error. 1050: Table 'A' already exists The error occured in MySQL 5.1 releases, but is not present in MySQL 5.5. This patch adds a regression test to ensure that the problem does not reoccur.
* merge from mysql-trunk-bugfixingJon Olav Hauglid2010-05-056-12/+42
|\
| * BUG#50670: Slave stops with error code 1644Sven Sandberg2010-04-284-12/+12
| | | | | | | | | | | | | | Clarified error messages related to unsafe statements: - avoid the internal technical term "row injection" - use 'binary log' instead of 'binlog' - avoid the word 'unsafeness'
| * only This is a backport of the patch for 47739 into trunk. Horst.Hunger2010-04-261-0/+15
| |
| * backport of patch for blckhole plugin (47748) to trunk-bugfixing.Horst.Hunger2010-04-261-0/+15
| |
* | Bug#46947 "Embedded SELECT without FOR UPDATE is causing a lock"Konstantin Osipov2010-04-281-5/+5
| | | | | | | | Update the result file to minor tweaks of the comments in the test case.
* | Committing on behalf or Dmitry Lenev:Konstantin Osipov2010-04-283-3/+1159
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for bug #46947 "Embedded SELECT without FOR UPDATE is causing a lock", with after-review fixes. SELECT statements with subqueries referencing InnoDB tables were acquiring shared locks on rows in these tables when they were executed in REPEATABLE-READ mode and with statement or mixed mode binary logging turned on. This was a regression which were introduced when fixing bug 39843. The problem was that for tables belonging to subqueries parser set TL_READ_DEFAULT as a lock type. In cases when statement/mixed binary logging at open_tables() time this type of lock was converted to TL_READ_NO_INSERT lock at open_tables() time and caused InnoDB engine to acquire shared locks on reads from these tables. Although in some cases such behavior was correct (e.g. for subqueries in DELETE) in case of SELECT it has caused unnecessary locking. This patch tries to solve this problem by rethinking our approach to how we handle locking for SELECT and subqueries. Now we always set TL_READ_DEFAULT lock type for all cases when we read data. When at open_tables() time this lock is interpreted as TL_READ_NO_INSERT or TL_READ depending on whether this statement as a whole or call to function which uses particular table should be written to the binary log or not (if yes then statement should be properly serialized with concurrent statements and stronger lock should be acquired). Test coverage is added for both InnoDB and MyISAM. This patch introduces an "incompatible" change in locking scheme for subqueries used in SELECT ... FOR UPDATE and SELECT .. IN SHARE MODE. In 4.1 the server would use a snapshot InnoDB read for subqueries in SELECT FOR UPDATE and SELECT .. IN SHARE MODE statements, regardless of whether the binary log is on or off. If the user required a different type of read (i.e. locking read), he/she could request so explicitly by providing FOR UPDATE/IN SHARE MODE clause for each individual subquery. On of the patches for 5.0 broke this behaviour (which was not documented or tested), and started to use locking reads fora all subqueries in SELECT ... FOR UPDATE/IN SHARE MODE. This patch restored 4.1 behaviour.
* BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside aAlfranio Correia2010-04-212-6/+2
| | | | | | | transaction BUG#52616 Temp table prevents switch binlog format from STATEMENT to ROW Post-merge fixes.
* merge from mysql-trunk-bugfixingJon Olav Hauglid2010-04-211-7/+14
|\
| * BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside aAlfranio Correia2010-04-201-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | transaction BUG#52616 Temp table prevents switch binlog format from STATEMENT to ROW Before the WL#2687 and BUG#46364, every non-transactional change that happened after a transactional change was written to trx-cache and flushed upon committing the transaction. WL#2687 and BUG#46364 changed this behavior and non-transactional changes are now written to the binary log upon committing the statement. A binary log event is identified as transactional or non-transactional through a flag in the Log_event which is set taking into account the underlie storage engine on what it is stems from. In the current bug, this flag was not being set properly when the DROP TEMPORARY TABLE was executed. However, while fixing this bug we figured out that changes to temporary tables should be always written to the trx-cache if there is an on-going transaction. Otherwise, binlog events in the reversed order would be produced. Regarding concurrency, keeping changes to temporary tables in the trx-cache is also safe as temporary tables are only visible to the owner connection. In this patch, we classify the following statements as unsafe: 1 - INSERT INTO t_myisam SELECT * FROM t_myisam_temp 2 - INSERT INTO t_myisam_temp SELECT * FROM t_myisam 3 - CREATE TEMPORARY TABLE t_myisam_temp SELECT * FROM t_myisam On the other hand, the following statements are classified as safe: 1 - INSERT INTO t_innodb SELECT * FROM t_myisam_temp 2 - INSERT INTO t_myisam_temp SELECT * FROM t_innodb The patch also guarantees that transactions that have a DROP TEMPORARY are always written to the binary log regardless of the mode and the outcome: commit or rollback. In particular, the DROP TEMPORARY is extended with the IF EXISTS clause when the current statement logging format is set to row. Finally, the patch allows to switch from STATEMENT to MIXED/ROW when there are temporary tables but the contrary is not possible.
* | merge from mysql-trunk-bugfixingJon Olav Hauglid2010-04-2046-187/+2858
|\ \ | |/
| * Automerge.Alexey Kopytov2010-04-195-21/+1541
| |\
| | * A fix for Bug#11918 "SP does not accept variables in LIMIT clause"Konstantin Osipov2010-04-141-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow stored procedure variables in LIMIT clause. Only allow variables of INTEGER types. Handle negative values by means of an implicit cast to UNSIGNED (similarly to prepared statement placeholders). Add tests. Make sure replication works by not doing NAME_CONST substitution for variables in LIMIT clause. Add replication tests.
| | * Backport of:Konstantin Osipov2010-04-133-21/+1430
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0 Bug#13174: SHA2 function Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle Implement SHA2 functions. Chad added code to make it work with YaSSL. Also, he removed the (probable) bug of embedded server never using SSL-dependent functions. (libmysqld/Makefile.am didn't read ANY autoconf defs.) Function specification: SHA2( string cleartext, integer hash_length ) -> string hash, or NULL where hash_length is one of 224, 256, 384, or 512. If either is NULL or a length is unsupported, then the result is NULL. The resulting string is always the length of the hash_length parameter or is NULL. Include the canonical hash examples from the NIST in the test results. --- Polish and address concerns of reviewers.
| | * Bug#51980 mysqld service crashes with a simple COUNT(DISTINCT) query over a viewoystein.grovlen@sun.com2010-04-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Segmentation fault in add_group_and_distinct_keys() when accessing field of what is assumed to be an Item_field object. Cause: In case of views, the item added to list by is_indexed_agg_distinct() was not of type Item_field, but Item_ref. Resolution: Add the real Item_field object, the one referred to by Item_ref object, to the list, instead.
| * | Automerge.Alexey Kopytov2010-04-1135-98/+1121
| |\ \ | | |/
| | * Fixed mysqld--help-win broken by the merge from trunk main.Alexey Kopytov2010-03-241-1/+1
| | |
| | * Manual merge of mysql-trunk into mysql-trunk-merge.Alexey Kopytov2010-03-24229-2148/+126896
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Text conflict in client/mysqlbinlog.cc Text conflict in mysql-test/Makefile.am Text conflict in mysql-test/collections/default.daily Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test Text conflict in mysys/charset.c Text conflict in sql/field.cc Text conflict in sql/field.h Text conflict in sql/item.h Text conflict in sql/item_func.cc Text conflict in sql/log.cc Text conflict in sql/log_event.cc Text conflict in sql/log_event_old.cc Text conflict in sql/mysqld.cc Text conflict in sql/rpl_utility.cc Text conflict in sql/rpl_utility.h Text conflict in sql/set_var.cc Text conflict in sql/share/Makefile.am Text conflict in sql/sql_delete.cc Text conflict in sql/sql_plugin.cc Text conflict in sql/sql_select.cc Text conflict in sql/sql_table.cc Text conflict in storage/example/ha_example.h Text conflict in storage/federated/ha_federated.cc Text conflict in storage/myisammrg/ha_myisammrg.cc Text conflict in storage/myisammrg/myrg_open.c
| | * \ Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.Alexey Kopytov2010-03-224-18/+57
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test Text conflict in sql/item_func.cc
| | | * \ Merging the latest changesAlexander Barkov2010-03-221-16/+16
| | | |\ \
| | | | * \ Merging with mysql-5.1-bugfixing.Mats Kindahl2010-03-221-2/+0
| | | | |\ \
| | | | * | | BUG#49618: Field length stored incorrectly in binary logMats Kindahl2010-03-221-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for InnoDB Patch to fix result files for the binlog suite under row- based replication.
| | | * | | | Bug #51976 LDML collations issue Alexander Barkov2010-03-221-0/+9
| | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: caseup_multiply and casedn_multiply members were not initialized for a dynamic collation, so UPPER() and LOWER() functions returned empty strings. Fix: initializing the members properly. Adding tests: mysql-test/r/ctype_ldml.result mysql-test/t/ctype_ldml.test Applying the fix: mysys/charset.c
| | | * | | Merge fix for bug 52060 into tip of 5.1-bugteam.John H. Embretsen2010-03-225-7/+110
| | | |\ \ \ | | | | |/ /
| | | | * | Bug #49910: Behavioural change in SELECT/WHERE on YEAR(4) data type ↵Gleb Shchepa2010-03-221-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Original patch by Sinisa Milivojevic) The YEAR(4) value of 2000 was equal to the "bad" YEAR(4) value of 0000. The get_year_value() function has been modified to not adjust bad YEAR(4) value to 2000.
| | | * | | Bug#52060 - test udf fails on Snow LeopardJohn H. Embretsen2010-03-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | reverse DNS lookup of "localhost" returns "broadcasthost" on Snow Leopard, and NULL on most others. Simply ignore the output, as this is not an essential part of UDF testing.
| | * | | | Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.Alexey Kopytov2010-03-2013-15/+615
| | |\ \ \ \ | | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Text conflict in mysql-test/r/partition_innodb.result Text conflict in sql/field.h Text conflict in sql/item.h Text conflict in sql/item_cmpfunc.h Text conflict in sql/item_sum.h Text conflict in sql/log_event_old.cc Text conflict in sql/protocol.cc Text conflict in sql/sql_select.cc Text conflict in sql/sql_yacc.yy
| | | * | | Bug#51242 HAVING clause on table join produce incorrect resultsSergey Glukhov2010-03-191-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that when we make conditon for grouped result const part of condition is cut off. It happens because some parts of 'having' condition which refer to outer join become const after make_join_statistics. These parts may be lost during further having condition transformation in JOIN::exec. The fix is adding 'having' condition check for const tables after make_join_statistics is performed.
| | | * | | Post-push fix to disable a subset of the test case for Bug#47762.Martin Hansson2010-03-191-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has been back-ported from 6.0 as the problems proved to afflict 5.1 as well. The fix exposed two new bugs. They were reported as follows. Bug no 52174: Sometimes wrong plan when reading a MAX value from non-NULL index Bug no 52173: Reading NULL value from non-NULL index gives wrong result in embedded server Both bugs taken together affect a much smaller class of queries than #47762, so the fix stays for now.
| | | * | | Bug#51598 Inconsistent behaviour with a COALESCE statement inside an IN ↵Sergey Glukhov2010-03-191-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comparison Optimizer erroneously translated LEFT JOIN into INNER JOIN. It leads to cutting rows with NULL right side. It happens because Item_row uses not_null_tables() method form the base(Item) class and does not calculate 'null tables' properly. The fix is adding calculation of 'not null tables' to Item_row.
| | | * | | Bug#51494 crash with join, explain and 'sounds like' operatorSergey Glukhov2010-03-191-0/+12
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash happens because of discrepancy between values of conts_tables and join->const_table_map(make_join_statisctics). Calculation of conts_tables used condition with HA_STATS_RECORDS_IS_EXACT flag check. Calculation of join->const_table_map does not use this flag check. In case of MERGE table without union with index the table does not become const table and thus join_read_const_table() is not called for the table. join->const_table_map supposes this table is const and later in make_join_select this table is used for making&calculation const condition. As table record buffer is not populated it leads to crash. The fix is adding a check if an engine supports HA_STATS_RECORDS_IS_EXACT flag before updating join->const_table_map.
| | | * | Bug #49838: DROP INDEX and ADD UNIQUE INDEX for same index may corruptGeorgi Kodinov2010-03-171-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definition at engine If a single ALTER TABLE contains both DROP INDEX and ADD INDEX using the same index name (a.k.a. index modification) we need to disable in-place alter table because we can't ask the storage engine to have two copies of the index with the same name even temporarily (if we first do the ADD INDEX and then DROP INDEX) and we can't modify indexes that are needed by e.g. foreign keys if we first do DROP INDEX and then ADD INDEX. Fixed the problem by disabling in-place ALTER TABLE for these cases.
| | | * | Merge fix for BUG47444 to mysql-5.1-bugteam.Sergey Vojtovich2010-03-161-0/+19
| | | |\ \
| | | | * \ Merge fix for BUG47444 to mysql-5.1-bugteam.Sergey Vojtovich2010-03-161-0/+19
| | | | |\ \
| | | | | * | BUG#47444 - --myisam_repair_threads>1can result in allSergey Vojtovich2010-03-121-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | index cardinalities=1 Parallel repair didn't poroperly update index cardinality in certain cases. When myisam_sort_buffer_size is not enough to store all keys, index cardinality was updated before index was actually written, when no index statistic is available.
| | | * | | | Merge of fix for Bug#47762.Martin Hansson2010-03-165-12/+242
| | | |\ \ \ \
| | | | * \ \ \ mergeMattias Jonsson2010-03-164-12/+221
| | | | |\ \ \ \ | | | | | |/ / / | | | | |/| | |
| | | | | * | | mergeMattias Jonsson2010-03-122-0/+133
| | | | | |\ \ \
| | | | | | * | | Bug#51830: Incorrect partition pruning on range partitionMattias Jonsson2010-03-102-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (regression) Problem was that partition pruning did not exclude the last partition if the range was beyond it (i.e. not using MAXVALUE) Fix was to not include the last partition if the partitioning function value was not within the partition range.
| | | | | * | | | mergeMattias Jonsson2010-03-121-11/+11
| | | | | |\ \ \ \
| | | | | | * | | | Bug#48229: group by performance issue of partitioned tableMattias Jonsson2010-03-121-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additional result file update
| | | | | * | | | | mergedMattias Jonsson2010-03-121-0/+42
| | | | | |\ \ \ \ \
| | | | | | * | | | | Bug#50392: insert_id is not reset for partitioned tablesMattias Jonsson2010-03-041-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | auto_increment on duplicate entry The bug was that when INSERT_ID was used and the storage engine was told to release any reserved but not used auto_increment values, it set the highest auto_increment value to INSERT_ID. The fix was to check if the auto_increment value was forced by user (INSERT_ID) or by slave-thread, i.e. not auto- generated. So that it is only allowed to release generated values.
| | | | | * | | | | | mergeMattias Jonsson2010-03-111-1/+21
| | | | | |\ \ \ \ \ \
| | | | | | * | | | | | Bug#50104: Partitioned table with just 1 partion works with fkMattias Jonsson2010-03-041-1/+21
| | | | | | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was no check for foreign keys when altering partitioned tables. Added check for FK when altering partitioned tables.
| | | | | * | | | | | mergeMattias Jonsson2010-03-111-0/+14
| | | | | |\ \ \ \ \ \ | | | | | | | |/ / / / | | | | | | |/| | | |
| | | | | | * | | | | Bug#48229: group by performance issue of partitioned tableMattias Jonsson2010-03-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was block_size on partitioned tables was not set, resulting in keys_per_block was not correct which affects the cost calculation for read time of indexes (including cost for group min/max).Which resulted in a bad optimizer decision. Fixed by setting stats.block_size correctly.
| | | | * | | | | | | Bug#50918: Date columns treated differently in Views than inMartin Hansson2010-03-161-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Base Tables The type inferrence of a view column caused the result to be interpreted as the wrong type: DATE colums were interpreted as TIME and TIME as DATETIME. This happened because view columns are represented by Item_ref objects as opposed to Item_field's. Item_ref had no method for retrieving a TIME value and thus was forced to depend on the default implementation for any expression, which caused the expression to be evaluated as a string and then parsed into a TIME/DATETIME value. Fixed by letting Item_ref classes forward the request for a TIME value to the referred Item - which is a field in this case - this reads the TIME value directly without conversion.
| | | * | | | | | | | Bug#47762: Incorrect result from MIN() when WHERE tests NOTMartin Hansson2010-03-161-0/+226
| | | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NULL column for NULL The optimization to read MIN() and MAX() values from an index did not properly handle comparisons with NULL values. Fixed by giving up the particular optimization step if there are non-NULL safe comparisons with NULL values, as the result is NULL anyway. Also, Oracle copyright notice was added to all files.