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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
034fbeb6
Commit
034fbeb6
authored
Nov 04, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add safe ariphmetic test to crash-me
sql-bench/crash-me.sh: add safe ariphmetic test
parent
9b7e5a7f
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 @
034fbeb6
...
@@ -2009,6 +2009,43 @@ find_limit("number of columns in group by","columns_in_group_by",
...
@@ -2009,6 +2009,43 @@ find_limit("number of columns in group by","columns_in_group_by",
[
"drop table crash_q
$drop_attr
"
]
,
[
"drop table crash_q
$drop_attr
"
]
,
$max_order_by
))
;
$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
# 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