@@ -1980,7 +1980,7 @@ bool execute_sql(const std::string &sql, Thd1 *thd) {
19801980void Table::SetEncryption (Thd1 *thd) {
19811981 std::string sql = " ALTER TABLE " + name_ + " ENCRYPTION = '" ;
19821982 std::string enc = g_encryption[rand_int (g_encryption.size () - 1 )];
1983- sql += enc + " '" ;
1983+ sql += enc + " '" + " , " + pick_algorithm_lock () ;
19841984 if (execute_sql (sql, thd)) {
19851985 table_mutex.lock ();
19861986 encryption = enc;
@@ -1992,14 +1992,19 @@ void Table::SetEncryption(Thd1 *thd) {
19921992void Table::SetTableCompression (Thd1 *thd) {
19931993 std::string sql = " ALTER TABLE " + name_ + " COMPRESSION= '" ;
19941994 std::string comp = g_compression[rand_int (g_compression.size () - 1 )];
1995- sql += comp + " '" ;
1995+ sql += comp + " '" + " , " + pick_algorithm_lock () ;
19961996 if (execute_sql (sql, thd)) {
19971997 table_mutex.lock ();
19981998 compression = comp;
19991999 table_mutex.unlock ();
20002000 }
20012001}
20022002
2003+ void Table::SetAlterEngine (Thd1 *thd) {
2004+ std::string sql = " ALTER TABLE " + name_ + " ENGINE=InnoDB," + pick_algorithm_lock ();
2005+ execute_sql (sql, thd);
2006+ }
2007+
20032008// todo pick relevent table//
20042009void Table::ModifyColumn (Thd1 *thd) {
20052010 std::string sql = " ALTER TABLE " + name_ + " MODIFY COLUMN " ;
@@ -3593,6 +3598,9 @@ bool Thd1::run_some_query() {
35933598 case Option::ALTER_TABLE_ENCRYPTION:
35943599 table->SetEncryption (this );
35953600 break ;
3601+ case Option::ALTER_ENGINE:
3602+ table->SetAlterEngine (this );
3603+ break ;
35963604 case Option::ALTER_TABLE_COMPRESSION:
35973605 table->SetTableCompression (this );
35983606 break ;
0 commit comments