diff options
author | unknown <jan@hundin.mysql.fi> | 2004-10-15 11:28:19 +0300 |
---|---|---|
committer | unknown <jan@hundin.mysql.fi> | 2004-10-15 11:28:19 +0300 |
commit | 1927d24ec0aa7589f370564c09686d8edcfeef32 (patch) | |
tree | 6381a679c742567c4419849501278ea4192605d3 /sql/ha_innodb.cc | |
parent | a55e476913aec3e2e1bdb5301b2dc581f7b268e0 (diff) | |
download | mariadb-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.cc | 25 |
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 */ |