3671 Mattias Jonsson 2011-12-16
WL#4443
Revertet non relevant plugin.test changes and ha_example changes
(reported as 13511529).
Moved query cache registration to be as before this patch
Disabled DBUG_ASSERT(inited == INDEX) in ha_index_first since
ha_index_init return value is not always checked.
(11746399, 11746275)
modified:
mysql-test/r/plugin.result
mysql-test/t/plugin.test
sql/handler.cc
sql/sql_select.cc
sql/sql_union.cc
storage/example/ha_example.cc
3670 Mattias Jonsson 2011-12-16 [merge]
Merge of WL#4443 with latest -trunk, due to moved code in sql_select.cc was pushed to -trunk
added:
mysql-test/r/partition_locking.result
mysql-test/t/partition_locking.test
modified:
mysql-test/include/commit.inc
mysql-test/r/commit_1innodb.result
mysql-test/r/explain.result
mysql-test/r/handler_myisam.result
mysql-test/r/partition_binlog.result
mysql-test/r/partition_explicit_prune.result
mysql-test/r/partition_pruning.result
mysql-test/r/partition_truncate.result
mysql-test/r/plugin.result
mysql-test/suite/innodb/r/innodb_corrupt_bit.result
mysql-test/suite/innodb/t/innodb_corrupt_bit.test
mysql-test/suite/perfschema/r/stage_mdl_function.result
mysql-test/t/explain.test
mysql-test/t/handler_myisam.test
mysql-test/t/partition_binlog.test
mysql-test/t/partition_explicit_prune.test
mysql-test/t/partition_pruning.test
mysql-test/t/partition_truncate.test
mysql-test/t/plugin.test
sql/ha_partition.cc
sql/ha_partition.h
sql/handler.cc
sql/handler.h
sql/item_cmpfunc.cc
sql/item_row.cc
sql/item_strfunc.cc
sql/item_subselect.cc
sql/log_event.cc
sql/opt_explain.cc
sql/opt_range.cc
sql/opt_range.h
sql/partition_info.cc
sql/partition_info.h
sql/share/errmsg-utf8.txt
sql/sp_head.cc
sql/sql_acl.cc
sql/sql_base.cc
sql/sql_base.h
sql/sql_cache.h
sql/sql_delete.cc
sql/sql_handler.cc
sql/sql_insert.cc
sql/sql_join_buffer.cc
sql/sql_lex.cc
sql/sql_lex.h
sql/sql_load.cc
sql/sql_optimizer.cc
sql/sql_parse.cc
sql/sql_partition.cc
sql/sql_partition_admin.cc
sql/sql_prepare.cc
sql/sql_resolver.cc
sql/sql_select.cc
sql/sql_select.h
sql/sql_union.cc
sql/sql_update.cc
storage/example/ha_example.cc
storage/innobase/handler/ha_innodb.cc
=== modified file 'mysql-test/r/plugin.result'
--- a/mysql-test/r/plugin.result 2011-12-16 09:48:48 +0000
+++ b/mysql-test/r/plugin.result 2011-12-16 20:28:07 +0000
@@ -9,29 +9,9 @@ ERROR HY000: Function 'EXAMPLE' already
UNINSTALL PLUGIN example;
INSTALL PLUGIN example SONAME 'ha_example.so';
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=EXAMPLE DEFAULT CHARSET=latin1
-# Kind of blackhole engine
-INSERT INTO t1 VALUES (0);
-# Only supports table scans (and does always return zero rows :)
SELECT * FROM t1;
-a
-# Since there are no rows found it will never try do update.
-UPDATE t1 SET a = 1 WHERE a = 0;
-# Since there are no rows found it will never try do delete.
-DELETE FROM t1 WHERE a = 0;
-# No support for SQL HANDLER statement
-HANDLER t1 OPEN;
ERROR HY000: Table storage engine for 't1' doesn't have this option
DROP TABLE t1;
-# example engine does not support indexes
-CREATE TABLE t1(a int PRIMARY KEY) ENGINE=EXAMPLE;
-ERROR 42000: Too many key parts specified; max 0 parts allowed
-CREATE TABLE t1(a int, KEY (a)) ENGINE=EXAMPLE;
-ERROR 42000: Too many key parts specified; max 0 parts allowed
set global example_ulong_var=500;
set global example_enum_var= e1;
show status like 'example%';
=== modified file 'mysql-test/t/plugin.test'
--- a/mysql-test/t/plugin.test 2011-12-16 09:48:48 +0000
+++ b/mysql-test/t/plugin.test 2011-12-16 20:28:07 +0000
@@ -17,35 +17,11 @@ eval INSTALL PLUGIN example SONAME '$EXA
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
-SHOW CREATE TABLE t1;
-
-# Let's do some advanced ops with the example engine :)
-
---echo # Kind of blackhole engine
-INSERT INTO t1 VALUES (0);
-
---echo # Only supports table scans (and does always return zero rows :)
-SELECT * FROM t1;
-
---echo # Since there are no rows found it will never try do update.
-UPDATE t1 SET a = 1 WHERE a = 0;
-
---echo # Since there are no rows found it will never try do delete.
-DELETE FROM t1 WHERE a = 0;
-
---echo # No support for SQL HANDLER statement
--error ER_ILLEGAL_HA
-HANDLER t1 OPEN;
+SELECT * FROM t1;
DROP TABLE t1;
---echo # example engine does not support indexes
---error ER_TOO_MANY_KEY_PARTS
-CREATE TABLE t1(a int PRIMARY KEY) ENGINE=EXAMPLE;
---error ER_TOO_MANY_KEY_PARTS
-CREATE TABLE t1(a int, KEY (a)) ENGINE=EXAMPLE;
-
-
# a couple of tests for variables
set global example_ulong_var=500;
set global example_enum_var= e1;
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2011-12-16 12:58:27 +0000
+++ b/sql/handler.cc 2011-12-16 20:28:07 +0000
@@ -2500,7 +2500,10 @@ int handler::ha_index_first(uchar * buf)
int result;
DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE ||
m_lock_type != F_UNLCK);
+#ifdef BUG11746399_IS_FIXED
+ /* Fails in innodb.innodb-index + innodb.innodb_corrupt_bit */
DBUG_ASSERT(inited == INDEX);
+#endif
MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
MYSQL_START_TABLE_IO_WAIT(locker, &state, m_psi,
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2011-12-16 12:58:27 +0000
+++ b/sql/sql_select.cc 2011-12-16 20:28:07 +0000
@@ -1206,7 +1206,7 @@ mysql_select(THD *thd,
/* Only register the query if it was opened above. */
if (thd->lex->tables_state < Query_tables_list::TABLES_STATE_LOCKED)
- store_in_query_cache= true;
+ query_cache_store_query(thd, thd->lex->query_tables);
if (mysql_prepare_select(thd, tables, wild_num, fields,
conds, og_num, first_order, first_group, having,
@@ -1231,10 +1231,6 @@ mysql_select(THD *thd,
DBUG_RETURN(true);
}
- /* We must wait after locking until we can store in the query cache */
- if (store_in_query_cache)
- query_cache_store_query(thd, thd->lex->query_tables);
-
if (mysql_execute_select(thd, select_lex, free_join, join))
DBUG_RETURN(true);
=== modified file 'sql/sql_union.cc'
--- a/sql/sql_union.cc 2011-12-16 12:58:27 +0000
+++ b/sql/sql_union.cc 2011-12-16 20:28:07 +0000
@@ -41,7 +41,7 @@ bool mysql_union(THD *thd, LEX *lex, sel
/* Only register the query if it was opened above */
if (thd->lex->tables_state < Query_tables_list::TABLES_STATE_LOCKED)
- store_in_query_cache= true;
+ query_cache_store_query(thd, thd->lex->query_tables);
res= unit->prepare(thd, result,
SELECT_NO_UNLOCK | setup_tables_done_option);
@@ -51,10 +51,6 @@ bool mysql_union(THD *thd, LEX *lex, sel
if (lock_query_tables(thd))
goto err;
- /* We should not store the query until after we got the locks */
- if (store_in_query_cache)
- query_cache_store_query(thd, thd->lex->query_tables);
-
res= unit->optimize() || unit->exec();
res|= unit->cleanup();
DBUG_RETURN(res);
=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc 2011-12-06 00:37:19 +0000
+++ b/storage/example/ha_example.cc 2011-12-16 20:28:07 +0000
@@ -554,7 +554,7 @@ int ha_example::index_last(uchar *buf)
int ha_example::rnd_init(bool scan)
{
DBUG_ENTER("ha_example::rnd_init");
- DBUG_RETURN(0);
+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
}
int ha_example::rnd_end()
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (mattias.jonsson:3670 to 3671) WL#4443 | Mattias Jonsson | 16 Dec |