Commit d94a32be authored by Will DeVries's avatar Will DeVries Committed by Sergei Petrunia

Rename create_table() as run_query() and remove identical functions.

parent 6195a016
......@@ -220,24 +220,7 @@ int clustrix_connection::rollback_stmt_trans()
return error_code;
}
int clustrix_connection::create_table(String &stmt)
{
int error_code = mysql_real_query(&clustrix_net, stmt.ptr(), stmt.length());
if (error_code)
return mysql_errno(&clustrix_net);
return error_code;
}
int clustrix_connection::delete_table(String &stmt)
{
int error_code = mysql_real_query(&clustrix_net, stmt.ptr(), stmt.length());
if (error_code)
return mysql_errno(&clustrix_net);
return error_code;
}
int clustrix_connection::rename_table(String &stmt)
int clustrix_connection::run_query(String &stmt)
{
int error_code = mysql_real_query(&clustrix_net, stmt.ptr(), stmt.length());
if (error_code)
......
......@@ -82,10 +82,7 @@ class clustrix_connection
return has_statement_trans;
}
int create_table(String &stmt);
int delete_table(String &stmt);
int rename_table(String &stmt);
int run_query(String &stmt);
int write_row(ulonglong clustrix_table_oid,
uchar *packed_row, size_t packed_size);
......
......@@ -233,10 +233,10 @@ int ha_clustrixdb::create(const char *name, TABLE *form, HA_CREATE_INFO *info)
createdb_stmt.append("CREATE DATABASE IF NOT EXISTS `");
createdb_stmt.append(form->s->db.str, form->s->db.length);
createdb_stmt.append("`");
trx->create_table(createdb_stmt);
trx->run_query(createdb_stmt);
}
error_code = trx->create_table(create_table_stmt);
error_code = trx->run_query(create_table_stmt);
return error_code;
}
......@@ -264,7 +264,7 @@ int ha_clustrixdb::delete_table(const char *path)
delete_cmd.append("`");
return trx->delete_table(delete_cmd);
return trx->run_query(delete_cmd);
}
int ha_clustrixdb::rename_table(const char* from, const char* to)
......@@ -301,7 +301,7 @@ int ha_clustrixdb::rename_table(const char* from, const char* to)
rename_cmd.append(decoded_to_tbname);
rename_cmd.append("`;");
return trx->rename_table(rename_cmd);
return trx->run_query(rename_cmd);
}
......
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