summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-09-10 17:45:09 +0200
committerSergei Golubchik <sergii@pisem.net>2014-09-10 17:45:09 +0200
commit3a91af9a920f8c167ba8c3669b53034c83ac20a1 (patch)
treed9bd7e675b7f31bb712f56d1374a5c18d0303e8e
parent30d7860504d58d645071ae1baf8572f03a90a994 (diff)
downloadmariadb-git-3a91af9a920f8c167ba8c3669b53034c83ac20a1.tar.gz
MDEV-6647 MariaDB CLI client doesnt show CREATE INDEX progress
SQLCOM_CREATE_INDEX was missing CF_REPORT_PROGRESS flag
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--tests/mysql_client_test.c20
2 files changed, 20 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4edbd3ba5be..a07e5c974f4 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -281,7 +281,7 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_CREATE_TABLE]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS |
CF_CAN_GENERATE_ROW_EVENTS;
- sql_command_flags[SQLCOM_CREATE_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_CREATE_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS;
sql_command_flags[SQLCOM_ALTER_TABLE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS |
CF_INSERTS_DATA;
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 78dd24fe6d4..51e549d9d1b 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -18707,13 +18707,31 @@ static void test_progress_reporting()
rc= mysql_query(conn, "insert into t1 (f2) select f2 from t2");
myquery(rc);
}
- rc= mysql_query(conn, "alter table t1 add f1 int primary key auto_increment, add key (f2), order by f2");
+
+ progress_stage= progress_max_stage= progress_count= 0;
+ rc= mysql_query(conn, "alter table t1 add f1 int primary key auto_increment, order by f2");
myquery(rc);
if (!opt_silent)
printf("Got progress_count: %u stage: %u max_stage: %u\n",
progress_count, progress_stage, progress_max_stage);
DIE_UNLESS(progress_count > 0 && progress_stage >=2 && progress_max_stage == 3);
+
+ progress_stage= progress_max_stage= progress_count= 0;
+ rc= mysql_query(conn, "create index f2 on t1 (f2)");
myquery(rc);
+ if (!opt_silent)
+ printf("Got progress_count: %u stage: %u max_stage: %u\n",
+ progress_count, progress_stage, progress_max_stage);
+ DIE_UNLESS(progress_count > 0 && progress_stage >=2 && progress_max_stage == 2);
+
+ progress_stage= progress_max_stage= progress_count= 0;
+ rc= mysql_query(conn, "drop index f2 on t1");
+ myquery(rc);
+ if (!opt_silent)
+ printf("Got progress_count: %u stage: %u max_stage: %u\n",
+ progress_count, progress_stage, progress_max_stage);
+ DIE_UNLESS(progress_count > 0 && progress_stage >=2 && progress_max_stage == 2);
+
rc= mysql_query(conn, "set @@global.progress_report_time=@save");
myquery(rc);
mysql_close(conn);