[Commits] 94f2bf4: Foo

Vicentiu Ciorbaru vicentiu at mariadb.org
Tue Dec 15 16:07:46 EET 2015


revision-id: 94f2bf46ca4267da24cae4b76ef964b7e0f5e893 (mariadb-10.0.22-64-g94f2bf4)
parent(s): 9d8ad0d79e3c3a1a9bf7c8cc6477ee4e69fba633
committer: Vicențiu Ciorbaru
timestamp: 2015-12-15 16:07:43 +0200
message:

Foo

---
 client/mysqlcheck.c            |  9 +++++----
 mysql-test/r/mysqlcheck.result | 19 +++++++++++++++++++
 mysql-test/t/mysqlcheck.test   | 22 ++++++++++++++++------
 3 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index b9e5478..9b6934d 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -160,9 +160,10 @@ static struct my_option my_long_options[] =
   {"password", 'p',
    "Password to use when connecting to server. If password is not given, it's solicited on the tty.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-  {"persistent", 'Z', "When using ANALYZE TABLE use the PERSISTENT FOR ALL option.",
-   &opt_persistent_all, &opt_persistent_all, 0, GET_BOOL, NO_ARG, 0, 0,
-   0, 0, 0, 0},
+  {"persistent", 'Z',
+   "When using ANALYZE TABLE use the PERSISTENT FOR ALL option.",
+   &opt_persistent_all, &opt_persistent_all, 0, GET_BOOL, NO_ARG,
+   0, 0, 0, 0, 0, 0},
 #ifdef __WIN__
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -912,7 +913,7 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
   case DO_ANALYZE:
     DBUG_ASSERT(!view);
     op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG";
-    if (opt_persistent_all)     end = strmov(end, " PERSISTENT FOR ALL");
+    if (opt_persistent_all) end = strmov(end, " PERSISTENT FOR ALL");
     break;
   case DO_OPTIMIZE:
     DBUG_ASSERT(!view);
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index b4bcdc4..66e23c1 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -347,6 +347,9 @@ CREATE TABLE test.`t.1` (id int);
 mysqlcheck test t.1
 test.t.1                                           OK
 drop table test.`t.1`;
+#
+# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such
+#
 create view v1 as select 1;
 mysqlcheck --process-views test
 test.v1                                            OK
@@ -361,6 +364,9 @@ test.v1                                            OK
 mysqlcheck --process-views --check-upgrade test
 test.v1                                            OK
 drop view v1;
+#
+# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views
+#
 create table t1(a int);
 mysqlcheck --process-views --check-upgrade --auto-repair test
 test.t1                                            OK
@@ -370,3 +376,16 @@ Repairing views
 test.v1                                            OK
 drop view v1;
 drop table t1;
+#
+#MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck
+#
+create table t1(a int);
+insert into t1 (a) values (1), (2), (3);
+select * from mysql.column_stats;
+db_name	table_name	column_name	min_value	max_value	nulls_ratio	avg_length	avg_frequency	hist_size	hist_type	histogram
+test.t1                                            Engine-independent statistics collected
+status   : OK
+select * from mysql.column_stats where db_name = 'test' and table_name = 't1';
+db_name	table_name	column_name	min_value	max_value	nulls_ratio	avg_length	avg_frequency	hist_size	hist_type	histogram
+test	t1	a	1	3	0.0000	4.0000	1.0000	0	NULL	NULL
+drop table t1;
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index 6cd0265..88f0d03 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -319,9 +319,9 @@ CREATE TABLE test.`t.1` (id int);
 
 drop table test.`t.1`;
 
-#
-# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such
-#
+--echo #
+--echo # MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such
+--echo #
 create view v1 as select 1;
 --echo mysqlcheck --process-views test
 --exec $MYSQL_CHECK --process-views test
@@ -340,12 +340,22 @@ create view v1 as select 1;
 drop view v1;
 
 
-#
-# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views
-#
+--echo #
+--echo # MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views
+--echo #
 create table t1(a int);
 --copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm
 --echo mysqlcheck --process-views --check-upgrade --auto-repair test
 --exec $MYSQL_CHECK --process-views --check-upgrade --auto-repair test
 drop view v1;
 drop table t1;
+
+--echo #
+--echo #MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck
+--echo #
+create table t1(a int);
+insert into t1 (a) values (1), (2), (3);
+select * from mysql.column_stats;
+--exec $MYSQL_CHECK --analyze test t1 --persistent
+select * from mysql.column_stats where db_name = 'test' and table_name = 't1';
+drop table t1;


More information about the commits mailing list