diff options
author | unknown <mskold@mysql.com> | 2006-06-02 07:26:45 +0200 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2006-06-02 07:26:45 +0200 |
commit | 22e3b0c66f695e18269e2fc221461611fa5132c3 (patch) | |
tree | 7ca1918d7c36ccdf31d0128f0777f63896bce3a5 /sql/ha_ndbcluster.cc | |
parent | 445e828785da97c7292103f539835098b2dd67b0 (diff) | |
download | mariadb-git-22e3b0c66f695e18269e2fc221461611fa5132c3.tar.gz |
Bug #18864 TRUNCATE TABLE doesn't reset AUTO_INCREMENT value on ndb table
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 3f2c6cbc6bb..ecbe42860ef 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3767,6 +3767,12 @@ int ha_ndbcluster::create(const char *name, set_dbname(name2); set_tabname(name2); + if (current_thd->lex->sql_command == SQLCOM_TRUNCATE) + { + DBUG_PRINT("info", ("Dropping and re-creating table for TRUNCATE")); + if ((my_errno= delete_table(name))) + DBUG_RETURN(my_errno); + } if (create_from_engine) { /* |