diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-10-31 00:25:26 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-10-31 00:25:26 +0100 |
commit | 09e97299ba893b7578cac8160b3b687b0594aeee (patch) | |
tree | a197980e92b9cc6e19d04bfb0efcaffdc483f2db /mysql-test | |
parent | a737135ae39dafe8b1136386ce23dfa8bed877f9 (diff) | |
parent | 31f1fe223e3ca0f2a44f7e55df05f096552ae61e (diff) | |
download | mariadb-git-09e97299ba893b7578cac8160b3b687b0594aeee.tar.gz |
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysql-test')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 15 | ||||
-rw-r--r-- | mysql-test/r/type_newdecimal.result | 44 | ||||
-rw-r--r-- | mysql-test/t/type_newdecimal.test | 45 |
3 files changed, 99 insertions, 5 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 63801357dd5..0ea628f75e0 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1152,7 +1152,7 @@ sub command_line_setup { 'debug' => \$opt_debug, 'debug-common' => \$opt_debug_common, 'debug-server' => \$opt_debug_server, - 'gdb' => \$opt_gdb, + 'gdb=s' => \$opt_gdb, 'client-gdb' => \$opt_client_gdb, 'manual-gdb' => \$opt_manual_gdb, 'manual-lldb' => \$opt_manual_lldb, @@ -1247,6 +1247,9 @@ sub command_line_setup { 'skip-test-list=s' => \@opt_skip_test_list ); + # fix options (that take an optional argument and *only* after = sign + my %fixopt = ( '--gdb' => '--gdb=#' ); + @ARGV = map { $fixopt{$_} or $_ } @ARGV; GetOptions(%options) or usage("Can't read options"); usage("") if $opt_usage; list_options(\%options) if $opt_list_options; @@ -6069,7 +6072,9 @@ sub gdb_arguments { # Put $args into a single string $input = $input ? "< $input" : ""; - if ($type ne 'client' and $opt_valgrind_mysqld) { + if ($type eq 'client') { + mtr_tofile($gdb_init_file, "set args @$$args $input"); + } elsif ($opt_valgrind_mysqld) { my $v = $$exe; my $vargs = []; valgrind_arguments($vargs, \$v); @@ -6079,7 +6084,11 @@ shell sleep 1 target remote | /usr/lib64/valgrind/../../bin/vgdb EOF } else { - mtr_tofile($gdb_init_file, "set args @$$args $input\n"); + mtr_tofile($gdb_init_file, + join("\n", + "set args @$$args $input", + split /;/, $opt_gdb || "" + )); } if ( $opt_manual_gdb ) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index ab075d29e22..5c7693d92c1 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1997,8 +1997,50 @@ select 0.0000000001 mod 1; select 0.01 mod 1; 0.01 mod 1 0.01 +CREATE TABLE t1 ( +`FLD1` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD2` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD3` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD4` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD5` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD6` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD7` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD8` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD9` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD10` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD11` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD12` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD13` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD14` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD15` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD16` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD17` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD18` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD19` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD20` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD21` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD22` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, +`FLD23` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000 +); +INSERT INTO t1 VALUES (001.0760,000.9500,001.0000,001.0000,001.0000, +001.0000,001.0000,001.0000,001.0000,001.0000,001.0000,000.5949,001.0194, +001.0000,001.0000,001.0000,001.0000,001.0000,001.0000,000.9220,001.1890,001.2130,327.2690); +select FLD1*FLD2*FLD3*FLD4*FLD5*FLD6*FLD7*FLD8*FLD9*FLD10*FLD11*FLD12*FLD13*FLD14*FLD15*FLD16*FLD17*FLD18*FLD19*FLD20*FLD21*FLD22*FLD23 as calc1 from t1; +calc1 +269.775757576440530322187032000000 +select FLD23*FLD2*FLD1*FLD4*FLD5*FLD11*FLD12*FLD13*FLD3*FLD15*FLD16*FLD17*FLD18*FLD19*FLD20*FLD21*FLD22*FLD14*FLD6*FLD7*FLD8*FLD9*FLD10 as calc2 from t1; +calc2 +269.775757576440530322187032000000 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT 1.0 * 2.000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `1.0 * 2.000` decimal(6,4) NOT NULL DEFAULT '0.0000' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; # -# Start of 10.0 tests +# End of 5.5 tests # # # MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 09149253c67..9de132863dc 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1581,8 +1581,51 @@ select 0.000000000000000000000000000000000000000000000000001 mod 1; select 0.0000000001 mod 1; select 0.01 mod 1; +# +# MDEV-17256 Decimal field multiplication bug +# + +CREATE TABLE t1 ( + `FLD1` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD2` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD3` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD4` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD5` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD6` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD7` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD8` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD9` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD10` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD11` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD12` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD13` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD14` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD15` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD16` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD17` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD18` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD19` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD20` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD21` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD22` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000, + `FLD23` decimal(7,4) unsigned zerofill NOT NULL DEFAULT 001.0000 +); + +INSERT INTO t1 VALUES (001.0760,000.9500,001.0000,001.0000,001.0000, + 001.0000,001.0000,001.0000,001.0000,001.0000,001.0000,000.5949,001.0194, + 001.0000,001.0000,001.0000,001.0000,001.0000,001.0000,000.9220,001.1890,001.2130,327.2690); + +select FLD1*FLD2*FLD3*FLD4*FLD5*FLD6*FLD7*FLD8*FLD9*FLD10*FLD11*FLD12*FLD13*FLD14*FLD15*FLD16*FLD17*FLD18*FLD19*FLD20*FLD21*FLD22*FLD23 as calc1 from t1; +select FLD23*FLD2*FLD1*FLD4*FLD5*FLD11*FLD12*FLD13*FLD3*FLD15*FLD16*FLD17*FLD18*FLD19*FLD20*FLD21*FLD22*FLD14*FLD6*FLD7*FLD8*FLD9*FLD10 as calc2 from t1; + +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT 1.0 * 2.000; +SHOW CREATE TABLE t1; +DROP TABLE t1; + --echo # ---echo # Start of 10.0 tests +--echo # End of 5.5 tests --echo # --echo # |