Commit 1827eb8a authored by Georgi Kodinov's avatar Georgi Kodinov

Bug #16996656: UNIQUE OPTION PREFIXES NOT DEPRECATED IN 5.5+

Backported the deprecation warnings from WL#6978 to 5.5
parent 45a3854a
# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -25,7 +25,7 @@ connect-timeout= 60 ...@@ -25,7 +25,7 @@ connect-timeout= 60
log-bin-trust-function-creators=1 log-bin-trust-function-creators=1
key_buffer_size= 1M key_buffer_size= 1M
sort_buffer= 256K sort_buffer_size= 256K
max_heap_table_size= 1M max_heap_table_size= 1M
loose-innodb_data_file_path= ibdata1:10M:autoextend loose-innodb_data_file_path= ibdata1:10M:autoextend
......
...@@ -5111,7 +5111,7 @@ CREATE TABLE b12809202_db.t1 (c1 INT); ...@@ -5111,7 +5111,7 @@ CREATE TABLE b12809202_db.t1 (c1 INT);
CREATE TABLE b12809202_db.t2 (c1 INT); CREATE TABLE b12809202_db.t2 (c1 INT);
INSERT INTO b12809202_db.t1 VALUES (1), (2), (3); INSERT INTO b12809202_db.t1 VALUES (1), (2), (3);
INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
# Starting mysqldump with --single-transaction & --flush-log options.. # Starting mysqldump with --single-transaction & --flush-logs options..
# Note : In the following dump the transaction # Note : In the following dump the transaction
# should start only after the logs are # should start only after the logs are
# flushed, as 'flush logs' causes implicit # flushed, as 'flush logs' causes implicit
......
...@@ -23,7 +23,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b'); ...@@ -23,7 +23,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
--source include/count_sessions.inc --source include/count_sessions.inc
--exec $MYSQL --xml test -e "select * from t1" --exec $MYSQL --xml test -e "select * from t1"
--exec $MYSQL_DUMP --xml --skip-create test --exec $MYSQL_DUMP --xml --skip-create-options test
--exec $MYSQL --xml test -e "select count(*) from t1" --exec $MYSQL --xml test -e "select count(*) from t1"
--exec $MYSQL --xml test -e "select 1 < 2 from dual" --exec $MYSQL --xml test -e "select 1 < 2 from dual"
......
...@@ -30,7 +30,7 @@ drop view if exists v1, v2, v3; ...@@ -30,7 +30,7 @@ drop view if exists v1, v2, v3;
CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024; CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
INSERT INTO t1 VALUES (1), (2); INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments -X test t1 --exec $MYSQL_DUMP --skip-create-options --skip-comments -X test t1
DROP TABLE t1; DROP TABLE t1;
--echo # --echo #
...@@ -73,14 +73,14 @@ SET SQL_MODE=@OLD_SQL_MODE; ...@@ -73,14 +73,14 @@ SET SQL_MODE=@OLD_SQL_MODE;
# check how mysqldump make quoting # check how mysqldump make quoting
--exec $MYSQL_DUMP --compact test t1 --exec $MYSQL_DUMP --compact test t1
--exec $MYSQL_DUMP --compact --skip-create test t1 --exec $MYSQL_DUMP --compact --skip-create-options test t1
--exec $MYSQL_DUMP --skip-create --skip-comments test t1 --exec $MYSQL_DUMP --skip-create-options --skip-comments test t1
--exec $MYSQL_DUMP --skip-opt --extended-insert --skip-comments test t1 --exec $MYSQL_DUMP --skip-opt --extended-insert --skip-comments test t1
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(a int, b text, c varchar(3)); CREATE TABLE t1(a int, b text, c varchar(3));
INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
--exec $MYSQL_DUMP --skip-create --compact -X test t1 --exec $MYSQL_DUMP --skip-create-options --compact -X test t1
DROP TABLE t1; DROP TABLE t1;
--echo # --echo #
...@@ -89,7 +89,7 @@ DROP TABLE t1; ...@@ -89,7 +89,7 @@ DROP TABLE t1;
CREATE TABLE t1 (`a"b"` char(2)); CREATE TABLE t1 (`a"b"` char(2));
INSERT INTO t1 VALUES ("1\""), ("\"2"); INSERT INTO t1 VALUES ("1\""), ("\"2");
--exec $MYSQL_DUMP --compact --skip-create -X test t1 --exec $MYSQL_DUMP --compact --skip-create-options -X test t1
DROP TABLE t1; DROP TABLE t1;
--echo # --echo #
...@@ -576,8 +576,8 @@ INSERT INTO t1 VALUES (1), (2); ...@@ -576,8 +576,8 @@ INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2); INSERT INTO t2 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2 --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2
--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db --exec $MYSQL_DUMP --skip-comments --skip-create-options --xml --no-data mysqldump_test_db
--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db t1 t2 --exec $MYSQL_DUMP --skip-comments --skip-create-options --xml --no-data mysqldump_test_db t1 t2
DROP TABLE t1, t2; DROP TABLE t1, t2;
DROP DATABASE mysqldump_test_db; DROP DATABASE mysqldump_test_db;
...@@ -1599,7 +1599,7 @@ drop database mysqldump_test_db; ...@@ -1599,7 +1599,7 @@ drop database mysqldump_test_db;
CREATE TABLE t1 (c1 INT, c2 LONGBLOB); CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
INSERT INTO t1 SET c1=11, c2=REPEAT('q',509); INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
--exec $MYSQL_DUMP --skip-create --compact --hex-blob test t1 --exec $MYSQL_DUMP --skip-create-options --compact --hex-blob test t1
DROP TABLE t1; DROP TABLE t1;
--echo # --echo #
...@@ -2175,7 +2175,7 @@ DROP TABLE t1, t2; ...@@ -2175,7 +2175,7 @@ DROP TABLE t1, t2;
--echo # --echo #
CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT'; CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT';
--exec $MYSQL_DUMP --compact --skip-create --xml test --exec $MYSQL_DUMP --compact --skip-create-options --xml test
DROP TABLE `comment_table`; DROP TABLE `comment_table`;
--echo # --echo #
...@@ -2343,7 +2343,7 @@ CREATE TABLE b12809202_db.t2 (c1 INT); ...@@ -2343,7 +2343,7 @@ CREATE TABLE b12809202_db.t2 (c1 INT);
INSERT INTO b12809202_db.t1 VALUES (1), (2), (3); INSERT INTO b12809202_db.t1 VALUES (1), (2), (3);
INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
--echo # Starting mysqldump with --single-transaction & --flush-log options.. --echo # Starting mysqldump with --single-transaction & --flush-logs options..
--echo # Note : In the following dump the transaction --echo # Note : In the following dump the transaction
--echo # should start only after the logs are --echo # should start only after the logs are
--echo # flushed, as 'flush logs' causes implicit --echo # flushed, as 'flush logs' causes implicit
...@@ -2354,7 +2354,7 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); ...@@ -2354,7 +2354,7 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
--echo --echo
--echo #### Dump starts here #### --echo #### Dump starts here ####
--replace_regex /-- Server version.*// /-- MySQL dump .*// /-- Dump completed on .*/-- Dump completed/ --replace_regex /-- Server version.*// /-- MySQL dump .*// /-- Dump completed on .*/-- Dump completed/
--exec $MYSQL_DUMP --verbose --single-transaction --flush-log b12809202_db 2>$MYSQLTEST_VARDIR/tmp/b12809202_stderr.sql --exec $MYSQL_DUMP --verbose --single-transaction --flush-logs b12809202_db 2>$MYSQLTEST_VARDIR/tmp/b12809202_stderr.sql
--echo --echo
--echo ## stderr ## --echo ## stderr ##
--cat_file $MYSQLTEST_VARDIR/tmp/b12809202_stderr.sql --cat_file $MYSQLTEST_VARDIR/tmp/b12809202_stderr.sql
......
...@@ -192,16 +192,16 @@ CREATE TABLE t1(a int); ...@@ -192,16 +192,16 @@ CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2); INSERT INTO t1 VALUES (1), (2);
# Run mysqldump # Run mysqldump
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test t1 --exec $MYSQL_DUMP --skip-create-options --skip-comments --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test t1
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test --exec $MYSQL_DUMP --skip-create-options --skip-comments --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test --exec $MYSQL_DUMP --skip-create-options --skip-comments --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test
# With wrong parameters # With wrong parameters
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 2 --error 2
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1 --exec $MYSQL_DUMP --skip-create-options --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
DROP TABLE t1; DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/tmp/test.sql --remove_file $MYSQLTEST_VARDIR/tmp/test.sql
......
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -829,6 +829,7 @@ static int findopt(char *optpat, uint length, ...@@ -829,6 +829,7 @@ static int findopt(char *optpat, uint length,
{ {
uint count; uint count;
const struct my_option *opt= *opt_res; const struct my_option *opt= *opt_res;
my_bool is_prefix= FALSE;
for (count= 0; opt->name; opt++) for (count= 0; opt->name; opt++)
{ {
...@@ -837,11 +838,14 @@ static int findopt(char *optpat, uint length, ...@@ -837,11 +838,14 @@ static int findopt(char *optpat, uint length,
(*opt_res)= opt; (*opt_res)= opt;
if (!opt->name[length]) /* Exact match */ if (!opt->name[length]) /* Exact match */
return 1; return 1;
if (!count) if (!count)
{ {
/* We only need to know one prev */ /* We only need to know one prev */
count= 1; count= 1;
*ffname= opt->name; *ffname= opt->name;
if (opt->name[length])
is_prefix= TRUE;
} }
else if (strcmp(*ffname, opt->name)) else if (strcmp(*ffname, opt->name))
{ {
...@@ -853,6 +857,12 @@ static int findopt(char *optpat, uint length, ...@@ -853,6 +857,12 @@ static int findopt(char *optpat, uint length,
} }
} }
} }
if (is_prefix && count == 1)
my_getopt_error_reporter(WARNING_LEVEL,
"Using unique option prefix %.*s instead of %s "
"is deprecated and will be removed in a future "
"release. Please use the full name instead.",
length, optpat, *ffname);
return count; return count;
} }
......
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