Skip to content

Commit

Permalink
MDEV-6647 MariaDB CLI client doesnt show CREATE INDEX progress
Browse files Browse the repository at this point in the history
SQLCOM_CREATE_INDEX was missing CF_REPORT_PROGRESS flag
  • Loading branch information
Sergei Golubchik committed Sep 10, 2014
1 parent 30d7860 commit 3a91af9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sql/sql_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 19 additions & 1 deletion tests/mysql_client_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3a91af9

Please sign in to comment.