2949 Marc Alff 2009-11-06
Restored original asserts on thd->lex_is_lex_started,
and implemented a work around instead.
modified:
sql/sql_base.cc
sql/table.cc
storage/perfschema/pfs_engine_table.cc
2948 Marc Alff 2009-11-06
Removed noise from unit test output.
added:
storage/perfschema/unittest/stub_print_error.h
modified:
storage/perfschema/unittest/Makefile.am
storage/perfschema/unittest/pfs-t.cc
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc 2009-11-03 22:02:10 +0000
+++ b/sql/sql_base.cc 2009-11-06 22:17:33 +0000
@@ -2530,6 +2530,9 @@ TABLE *open_table(THD *thd, TABLE_LIST *
HASH_SEARCH_STATE state;
DBUG_ENTER("open_table");
+ /* Parsing of partitioning information from .frm needs thd->lex set up. */
+ DBUG_ASSERT(thd->lex->is_lex_started);
+
/* find a unused table in the open table cache */
if (refresh)
*refresh=0;
=== modified file 'sql/table.cc'
--- a/sql/table.cc 2009-11-03 22:02:10 +0000
+++ b/sql/table.cc 2009-11-06 22:17:33 +0000
@@ -1652,6 +1652,9 @@ int open_table_from_share(THD *thd, TABL
DBUG_PRINT("enter",("name: '%s.%s' form: 0x%lx", share->db.str,
share->table_name.str, (long) outparam));
+ /* Parsing of partitioning information from .frm needs thd->lex set up. */
+ DBUG_ASSERT(thd->lex->is_lex_started);
+
error= 1;
bzero((char*) outparam, sizeof(*outparam));
outparam->in_use= thd;
=== modified file 'storage/perfschema/pfs_engine_table.cc'
--- a/storage/perfschema/pfs_engine_table.cc 2009-11-04 23:24:51 +0000
+++ b/storage/perfschema/pfs_engine_table.cc 2009-11-06 22:17:33 +0000
@@ -102,12 +102,21 @@ void PFS_engine_table_share::check_one_t
tables.init_one_table(PERFORMANCE_SCHEMA_str.str,
m_name.str, TL_READ);
+ /* Work around until Bug#32115 is backported. */
+ LEX dummy_lex;
+ LEX *old_lex= thd->lex;
+ thd->lex= &dummy_lex;
+ lex_start(thd);
+
if (! simple_open_n_lock_tables(thd, &tables))
{
if (!table_check_intact(tables.table, m_field_count, m_field_types))
m_checked= true;
close_thread_tables(thd);
}
+
+ lex_end(&dummy_lex);
+ thd->lex= old_lex;
}
/** Initialize all the table share locks. */
Attachment: [text/bzr-bundle] bzr/marc.alff@sun.com-20091106221733-y2vduzzwhiv3evnp.bundle
| Thread |
|---|
| • bzr push into mysql-trunk-perfschema branch (marc.alff:2948 to 2949) | Marc Alff | 6 Nov 2009 |