summaryrefslogtreecommitdiff
path: root/storage/connect
diff options
context:
space:
mode:
authorMathew Heard <splitice@users.noreply.github.com>2022-02-03 17:39:29 +1100
committerDaniel Black <daniel@mariadb.org>2022-05-27 11:15:07 +1000
commitc4e87cb22cd78b5539202d9dcf13954375decb67 (patch)
treeec5aa839a9e6d09466baad880894dd856667dd88 /storage/connect
parent31e30329a368a32d9de202748987592cc86db241 (diff)
downloadmariadb-git-c4e87cb22cd78b5539202d9dcf13954375decb67.tar.gz
MDEV-9020: Connect issues ALTER TABLE DISABLE KEYS when inserting data
If the connecting user doesn't have alter table privilege this isn't allowed. This patch removes enable / disable key commands that should never have been here Closes #2002
Diffstat (limited to 'storage/connect')
-rw-r--r--storage/connect/tabmysql.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp
index a701db1e8e9..0d7cb6d50c4 100644
--- a/storage/connect/tabmysql.cpp
+++ b/storage/connect/tabmysql.cpp
@@ -946,15 +946,6 @@ bool TDBMYSQL::OpenDB(PGLOBAL g)
} // endif MakeInsert
- if (m_Rc != RC_FX) {
- char cmd[64];
- int w;
-
- sprintf(cmd, "ALTER TABLE `%s` DISABLE KEYS", TableName);
-
- m_Rc = Myc.ExecSQL(g, cmd, &w); // may fail for some engines
- } // endif m_Rc
-
} else
// m_Rc = (Mode == MODE_DELETE) ? MakeDelete(g) : MakeUpdate(g);
m_Rc = (MakeCommand(g)) ? RC_FX : RC_OK;
@@ -1216,16 +1207,6 @@ int TDBMYSQL::DeleteDB(PGLOBAL g, int irc)
void TDBMYSQL::CloseDB(PGLOBAL g)
{
if (Myc.Connected()) {
- if (Mode == MODE_INSERT) {
- char cmd[64];
- int w;
- PDBUSER dup = PlgGetUser(g);
-
- dup->Step = "Enabling indexes";
- sprintf(cmd, "ALTER TABLE `%s` ENABLE KEYS", TableName);
- Myc.m_Rows = -1; // To execute the query
- m_Rc = Myc.ExecSQL(g, cmd, &w); // May fail for some engines
- } // endif m_Rc
Myc.Close();
} // endif Myc