Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
3081ae60
Commit
3081ae60
authored
Nov 04, 2002
by
walrus@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add safe ariphmetic test to crash-me
parent
be2cad20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
sql-bench/crash-me.sh
sql-bench/crash-me.sh
+37
-0
No files found.
sql-bench/crash-me.sh
View file @
3081ae60
...
...
@@ -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
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment