summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <jan@hundin.mysql.fi>2004-10-15 11:28:19 +0300
committerunknown <jan@hundin.mysql.fi>2004-10-15 11:28:19 +0300
commit1927d24ec0aa7589f370564c09686d8edcfeef32 (patch)
tree6381a679c742567c4419849501278ea4192605d3 /sql/ha_innodb.cc
parenta55e476913aec3e2e1bdb5301b2dc581f7b268e0 (diff)
downloadmariadb-git-1927d24ec0aa7589f370564c09686d8edcfeef32.tar.gz
Use already parsed SQL-query in the current thread when determining
was the query REPLACE or LOAD DATA INFILE REPLACE. innobase/row/row0ins.c: Find SQL-query directly from current thread and see if the query was REPLACE or LOAD DATA INFILE REPLACE. sql/ha_innodb.cc: Find current thread and return true if SQL-query in the current thread was either REPLACE or LOAD DATA INFILE REPLACE.
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index d748c005d02..28f95611ae7 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -5468,4 +5468,29 @@ innobase_get_at_most_n_mbchars(
}
}
+extern "C" {
+/**********************************************************************
+This function returns true if SQL-query in the current thread
+is either REPLACE or LOAD DATA INFILE REPLACE.
+NOTE that /mysql/innobase/row/row0ins.c must contain the
+prototype for this function ! */
+
+ibool
+innobase_query_is_replace(void)
+/*===========================*/
+{
+ THD* thd;
+
+ thd = (THD *)innobase_current_thd();
+
+ if ( thd->lex->sql_command == SQLCOM_REPLACE ||
+ ( thd->lex->sql_command == SQLCOM_LOAD &&
+ thd->lex->duplicates == DUP_REPLACE )) {
+ return true;
+ } else {
+ return false;
+ }
+}
+}
+
#endif /* HAVE_INNOBASE_DB */