summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Kodinov <georgi.kodinov@oracle.com>2013-06-26 12:19:02 +0300
committerGeorgi Kodinov <georgi.kodinov@oracle.com>2013-06-26 12:19:02 +0300
commit8d87015412d574566107ecb3c8d875e11d6bbb81 (patch)
tree808f0571d9278718300cd1d54e8428b318c0b717
parent26d14295a1e3ae5039dbcb435bb1740d25bd24b5 (diff)
downloadmariadb-git-8d87015412d574566107ecb3c8d875e11d6bbb81.tar.gz
Bug #16996656: UNIQUE OPTION PREFIXES NOT DEPRECATED IN 5.5+
Backported the deprecation warnings from WL#6978 to 5.5
-rw-r--r--mysql-test/include/default_mysqld.cnf4
-rw-r--r--mysql-test/r/mysqldump.result2
-rw-r--r--mysql-test/t/client_xml.test2
-rw-r--r--mysql-test/t/mysqldump.test22
-rw-r--r--mysql-test/t/openssl_1.test8
-rw-r--r--mysys/my_getopt.c12
6 files changed, 30 insertions, 20 deletions
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index 6a3fd881b9f..09aa9dafafd 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -1,4 +1,4 @@
-# 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
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ connect-timeout= 60
log-bin-trust-function-creators=1
key_buffer_size= 1M
-sort_buffer= 256K
+sort_buffer_size= 256K
max_heap_table_size= 1M
loose-innodb_data_file_path= ibdata1:10M:autoextend
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 96ab16f113f..a31516d10d2 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -5111,7 +5111,7 @@ CREATE TABLE b12809202_db.t1 (c1 INT);
CREATE TABLE b12809202_db.t2 (c1 INT);
INSERT INTO b12809202_db.t1 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
# should start only after the logs are
# flushed, as 'flush logs' causes implicit
diff --git a/mysql-test/t/client_xml.test b/mysql-test/t/client_xml.test
index 0847e2b366b..86ca0a920ad 100644
--- a/mysql-test/t/client_xml.test
+++ b/mysql-test/t/client_xml.test
@@ -23,7 +23,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
--source include/count_sessions.inc
--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 1 < 2 from dual"
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index b6af97c6f41..478d8fb2863 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -30,7 +30,7 @@ drop view if exists v1, v2, v3;
CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
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;
--echo #
@@ -73,14 +73,14 @@ SET SQL_MODE=@OLD_SQL_MODE;
# check how mysqldump make quoting
--exec $MYSQL_DUMP --compact test t1
---exec $MYSQL_DUMP --compact --skip-create test t1
---exec $MYSQL_DUMP --skip-create --skip-comments test t1
+--exec $MYSQL_DUMP --compact --skip-create-options test t1
+--exec $MYSQL_DUMP --skip-create-options --skip-comments test t1
--exec $MYSQL_DUMP --skip-opt --extended-insert --skip-comments test t1
DROP TABLE t1;
CREATE TABLE t1(a int, b text, c varchar(3));
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;
--echo #
@@ -89,7 +89,7 @@ DROP TABLE t1;
CREATE TABLE t1 (`a"b"` char(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;
--echo #
@@ -576,8 +576,8 @@ INSERT INTO t1 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 t1 t2
---exec $MYSQL_DUMP --skip-comments --skip-create --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
+--exec $MYSQL_DUMP --skip-comments --skip-create-options --xml --no-data mysqldump_test_db t1 t2
DROP TABLE t1, t2;
DROP DATABASE mysqldump_test_db;
@@ -1599,7 +1599,7 @@ drop database mysqldump_test_db;
CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
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;
--echo #
@@ -2175,7 +2175,7 @@ DROP TABLE t1, t2;
--echo #
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`;
--echo #
@@ -2343,7 +2343,7 @@ CREATE TABLE b12809202_db.t2 (c1 INT);
INSERT INTO b12809202_db.t1 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 # should start only after the logs are
--echo # flushed, as 'flush logs' causes implicit
@@ -2354,7 +2354,7 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
--echo
--echo #### Dump starts here ####
--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 ## stderr ##
--cat_file $MYSQLTEST_VARDIR/tmp/b12809202_stderr.sql
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 3e907f196be..0993d0a52ed 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -192,16 +192,16 @@ CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
# 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
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--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;
--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 8575fde0ca9..8d1da06af8c 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -1,4 +1,4 @@
-/* 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
it under the terms of the GNU General Public License as published by
@@ -829,6 +829,7 @@ static int findopt(char *optpat, uint length,
{
uint count;
const struct my_option *opt= *opt_res;
+ my_bool is_prefix= FALSE;
for (count= 0; opt->name; opt++)
{
@@ -837,11 +838,14 @@ static int findopt(char *optpat, uint length,
(*opt_res)= opt;
if (!opt->name[length]) /* Exact match */
return 1;
+
if (!count)
{
/* We only need to know one prev */
count= 1;
*ffname= opt->name;
+ if (opt->name[length])
+ is_prefix= TRUE;
}
else if (strcmp(*ffname, opt->name))
{
@@ -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;
}