summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2008-10-02 16:13:42 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2008-10-02 16:13:42 -0300
commit5b1afb9b9a5bd7d8344420c3b877a7ce3878e2d7 (patch)
treef702c06e83899752b9f3f0890bebd057979f2837 /sql/sql_base.cc
parent7adf7154f7c3d09dacf64872620f44d28b0a8bdc (diff)
downloadmariadb-git-5b1afb9b9a5bd7d8344420c3b877a7ce3878e2d7.tar.gz
Remove usage of the _db_strict_keyword_ in favor of the more reliable
DBUG_EXECUTE_IF macro. The usage of the former caused breakage in other trees as it got removed from the dbug library. sql/sql_base.cc: Rework code to remove unreliable usage of _db_script_keyword_.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 49efc72ba68..ad9af040dbb 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3720,6 +3720,18 @@ void assign_new_table_id(TABLE_SHARE *share)
DBUG_VOID_RETURN;
}
+/* Cause a spurious statement reprepare for debug purposes. */
+static inline bool inject_reprepare(THD *thd)
+{
+ if (thd->m_reprepare_observer && thd->stmt_arena->is_reprepared == FALSE)
+ {
+ thd->m_reprepare_observer->report_error(thd);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/**
Compare metadata versions of an element obtained from the table
definition cache and its corresponding node in the parse tree.
@@ -3773,15 +3785,7 @@ check_and_update_table_version(THD *thd,
tables->set_table_ref_id(table_share);
}
-#ifndef DBUG_OFF
- /* Spuriously reprepare each statement. */
- if (_db_strict_keyword_("reprepare_each_statement") &&
- thd->m_reprepare_observer && thd->stmt_arena->is_reprepared == FALSE)
- {
- thd->m_reprepare_observer->report_error(thd);
- return TRUE;
- }
-#endif
+ DBUG_EXECUTE_IF("reprepare_each_statement", return inject_reprepare(thd););
return FALSE;
}