diff options
author | unknown <walrus@mysql.com> | 2002-11-05 00:15:12 +0500 |
---|---|---|
committer | unknown <walrus@mysql.com> | 2002-11-05 00:15:12 +0500 |
commit | b749585481d63b3e94e4c7258ea3ca87c340f117 (patch) | |
tree | ae5b571aecb89670c8792c874dec95a53de79afe /sql-bench | |
parent | 8285b95779f848daffdaa5e3096a75467e458d24 (diff) | |
parent | 9cd8bd657e740affc0018644e157c67d85a84779 (diff) | |
download | mariadb-git-b749585481d63b3e94e4c7258ea3ca87c340f117.tar.gz |
Merge mysql.com:/home/walrus/bk/41 into mysql.com:/home/walrus/bk/41.1
Diffstat (limited to 'sql-bench')
-rw-r--r-- | sql-bench/crash-me.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index d66e8f47d6a..02e3072a3f9 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -2009,6 +2009,43 @@ find_limit("number of columns in group by","columns_in_group_by", ["drop table crash_q $drop_attr"], $max_order_by)); + + +# Safe arithmetic test + +$prompt="safe decimal arithmetic"; +$key="safe_decimal_arithmetic"; +if (!defined($limits{$key})) +{ + print "$prompt="; + save_incomplete($limit,$prompt); + if (!safe_query($server->create("crash_me_a",["a decimal(10,2)","b decimal(10,2)"]))) + { + print DBI->errstr(); + die "Can't create table 'crash_me_a' $DBI::errstr\n"; + }; + + if (!safe_query(["insert into crash_me_a (a,b) values (11.4,18.9)"])) + { + die "Can't insert into table 'crash_me_a' a record: $DBI::errstr\n"; + }; + + $arithmetic_safe = 'no'; + $arithmetic_safe = 'yes' + if ( (safe_query_result('select count(*) from crash_me_a where a+b=30.3',1,0) == 0) + and (safe_query_result('select count(*) from crash_me_a where a+b-30.3 = 0',1,0) == 0) + and (safe_query_result('select count(*) from crash_me_a where a+b-30.3 < 0',0,0) == 0) + and (safe_query_result('select count(*) from crash_me_a where a+b-30.3 > 0',0,0) == 0) ); + save_config_data($key,$arithmetic_safe,$prompt); + print "$arithmetic_safe\n"; + assert("drop table crash_me_a $drop_attr"); +} + else +{ + print "$prompt=$limits{$key} (cached)\n"; +} + + # # End of test # |