diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2013-10-11 13:57:56 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2013-10-11 13:57:56 +0200 |
commit | ca4c54aaeed00e5a0b9f09c0e94ee12bf77cbf9d (patch) | |
tree | 63f98d1926b4eeed86ab5e5588027c5978b564d8 /storage/connect/tabmysql.cpp | |
parent | 8619da05d94410bd57254e52dbdcb372f989e355 (diff) | |
download | mariadb-git-ca4c54aaeed00e5a0b9f09c0e94ee12bf77cbf9d.tar.gz |
- Fix bug when closing some table types
modified:
storage/connect/tabmul.cpp
storage/connect/tabmysql.cpp
storage/connect/tabodbc.cpp
- Add Insert support for ODBC table
Add the send command feature to ODBC tables
(not documented yet)
modified:
storage/connect/ha_connect.cc
storage/connect/myconn.cpp
storage/connect/odbccat.h
storage/connect/odbconn.cpp
storage/connect/odbconn.h
storage/connect/tabodbc.cpp
storage/connect/tabodbc.h
Diffstat (limited to 'storage/connect/tabmysql.cpp')
-rw-r--r-- | storage/connect/tabmysql.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 2ccb594439f..b1353a47013 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -1043,18 +1043,20 @@ int TDBMYSQL::DeleteDB(PGLOBAL g, int irc) /***********************************************************************/ void TDBMYSQL::CloseDB(PGLOBAL g) { - if (Mode == MODE_INSERT) { - char cmd[64]; - int w; - PDBUSER dup = PlgGetUser(g); - - dup->Step = "Enabling indexes"; - sprintf(cmd, "ALTER TABLE `%s` ENABLE KEYS", Tabname); - Myc.m_Rows = -1; // To execute the query - m_Rc = Myc.ExecSQL(g, cmd, &w); - } // endif m_Rc - - Myc.Close(); + 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", Tabname); + Myc.m_Rows = -1; // To execute the query + m_Rc = Myc.ExecSQL(g, cmd, &w); + } // endif m_Rc + + Myc.Close(); + } // endif Myc if (trace) htrc("MySQL CloseDB: closing %s rc=%d\n", Name, m_Rc); |