summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorvva@eagle.mysql.r18.ru <>2004-04-05 23:18:16 +0500
committervva@eagle.mysql.r18.ru <>2004-04-05 23:18:16 +0500
commit7b68b266239f1de612c50044064c0cd1cba5fb5d (patch)
tree0fd6f412bcb8636e776d8fd6a514ddbdf4caf764 /mysql-test
parent23a5fc55588a2acea2d529ae4d7c8696c6f8522c (diff)
downloadmariadb-git-7b68b266239f1de612c50044064c0cd1cba5fb5d.tar.gz
fixed Bug #3361 "mysqldump quotes DECIMAL values"
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysqldump.result18
-rw-r--r--mysql-test/t/mysqldump.test28
2 files changed, 44 insertions, 2 deletions
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 837a3627647..714cb42af5e 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -22,8 +22,8 @@ CREATE TABLE t1 (
a decimal(240,20) default NULL
) TYPE=MyISAM;
-INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890.00000000000000000000");
-INSERT INTO t1 VALUES ("0987654321098765432109876543210987654321.00000000000000000000");
+INSERT INTO t1 VALUES ('1234567890123456789012345678901234567890.00000000000000000000');
+INSERT INTO t1 VALUES ('0987654321098765432109876543210987654321.00000000000000000000');
DROP TABLE t1;
CREATE TABLE t1 (a double);
@@ -35,3 +35,17 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (RES);
DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
+INSERT INTO t1 VALUES (1.2345, 2.3456);
+INSERT INTO t1 VALUES ('1.2345', 2.3456);
+INSERT INTO t1 VALUES ("1.2345", 2.3456);
+CREATE TABLE t1 (
+ a decimal(10,5) default NULL,
+ b float default NULL
+) TYPE=MyISAM;
+
+INSERT INTO t1 VALUES ('1.23450',2.3456);
+INSERT INTO t1 VALUES ('1.23450',2.3456);
+INSERT INTO t1 VALUES ('1.23450',2.3456);
+
+DROP TABLE t1;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index bc63dc37d96..d1394e40a49 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -30,3 +30,31 @@ INSERT INTO t1 VALUES (-9e999999);
--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
--exec $MYSQL_DUMP --skip-comments test t1
DROP TABLE t1;
+
+#
+# Bug #3361 mysqldum quotes DECIMAL values
+#
+
+CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
+
+# check at first how mysql work with quoted decimal
+
+INSERT INTO t1 VALUES (1.2345, 2.3456);
+INSERT INTO t1 VALUES ('1.2345', 2.3456);
+INSERT INTO t1 VALUES ("1.2345", 2.3456);
+
+# The code below should be uncommented in mysql-4.1 to fix
+# behaviour of quoting DECIMAL fields with different
+# values of sql_mode
+########
+#SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES';
+#INSERT INTO t1 VALUES (1.2345, 2.3456);
+#INSERT INTO t1 VALUES ('1.2345', 2.3456);
+#--error 1054
+#INSERT INTO t1 VALUES ("1.2345", 2.3456);
+#SET SQL_MODE=@OLD_SQL_MODE;
+########
+
+# check how mysqldump make quoting
+--exec $MYSQL_DUMP --skip-comments test t1
+DROP TABLE t1;