Commit 04fc4ead authored by Roman Nozdrin's avatar Roman Nozdrin Committed by Sergei Petrunia

CLX-6 Create non-existed schemas at CLX BE on CREATE TABLE to

        syncronize the schema list at MDB FE and CLX BE.
parent 82faccc5
#CREATE DATABASE clx; CREATE DATABASE clx;
#USE clx; USE clx;
DROP TABLE IF EXISTS cx1; DROP TABLE IF EXISTS cx1;
CREATE TABLE cx1(i BIGINT)ENGINE=clustrixdb; CREATE TABLE cx1(i BIGINT)ENGINE=clustrixdb;
...@@ -15,5 +15,5 @@ DROP TABLE cx1; ...@@ -15,5 +15,5 @@ DROP TABLE cx1;
--error ER_NO_SUCH_TABLE --error ER_NO_SUCH_TABLE
SHOW CREATE TABLE cx1; SHOW CREATE TABLE cx1;
#USE test; USE test;
#DROP DATABASE cxl; DROP DATABASE clx;
...@@ -232,6 +232,15 @@ int ha_clustrixdb::create(const char *name, TABLE *form, HA_CREATE_INFO *info) ...@@ -232,6 +232,15 @@ int ha_clustrixdb::create(const char *name, TABLE *form, HA_CREATE_INFO *info)
if (error_code) if (error_code)
return error_code; return error_code;
// To syncronize the schemas of MDB FE and CLX BE.
if (form->s && form->s->db.length) {
String createdb_stmt;
createdb_stmt.append("CREATE DATABASE IF NOT EXISTS `");
createdb_stmt.append(form->s->db.str, form->s->db.length);
createdb_stmt.append("`");
trx->clustrix_net->create_table(createdb_stmt);
}
error_code = trx->clustrix_net->create_table(create_table_stmt); error_code = trx->clustrix_net->create_table(create_table_stmt);
return error_code; return error_code;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment