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
1759c97d
Commit
1759c97d
authored
Feb 24, 2008
by
tnurnberg@white.intern.koehntopp.de
Browse files
Options
Browse Files
Download
Plain Diff
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into mysql.com:/misc/mysql/20752/51-20752
parents
62300827
1ed076e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+5
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+7
-0
sql/item_func.cc
sql/item_func.cc
+14
-4
No files found.
mysql-test/r/func_str.result
View file @
1759c97d
...
...
@@ -1431,6 +1431,11 @@ benchmark(100, NULL)
select benchmark(NULL, 1+1);
benchmark(NULL, 1+1)
NULL
select benchmark(-1, 1);
benchmark(-1, 1)
NULL
Warnings:
Error 1411 Incorrect count value: '-1' for function benchmark
set @password="password";
set @my_data="clear text to encode";
select md5(encode(@my_data, "password"));
...
...
mysql-test/t/func_str.test
View file @
1759c97d
...
...
@@ -874,6 +874,13 @@ select benchmark(0, NULL);
select
benchmark
(
100
,
NULL
);
select
benchmark
(
NULL
,
1
+
1
);
#
# Bug #20752: BENCHMARK with many iterations returns too quickly
#
# not a string, but belongs with the above Bug#22684
select
benchmark
(
-
1
,
1
);
#
# Please note:
# 1) The collation of the password is irrelevant, the encryption uses
...
...
sql/item_func.cc
View file @
1759c97d
...
...
@@ -3646,18 +3646,28 @@ longlong Item_func_benchmark::val_int()
String
tmp
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
);
my_decimal
tmp_decimal
;
THD
*
thd
=
current_thd
;
ulong
loop_count
;
ulong
long
loop_count
;
loop_count
=
(
ulong
)
args
[
0
]
->
val_int
();
loop_count
=
(
ulong
long
)
args
[
0
]
->
val_int
();
if
(
args
[
0
]
->
null_value
)
if
(
args
[
0
]
->
null_value
||
(
!
args
[
0
]
->
unsigned_flag
&&
(((
longlong
)
loop_count
)
<
0
)))
{
if
(
!
args
[
0
]
->
null_value
)
{
char
buff
[
22
];
llstr
(((
longlong
)
loop_count
),
buff
);
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_ERROR
,
ER_WRONG_VALUE_FOR_TYPE
,
ER
(
ER_WRONG_VALUE_FOR_TYPE
),
"count"
,
buff
,
"benchmark"
);
}
null_value
=
1
;
return
0
;
}
null_value
=
0
;
for
(
ulong
loop
=
0
;
loop
<
loop_count
&&
!
thd
->
killed
;
loop
++
)
for
(
ulong
long
loop
=
0
;
loop
<
loop_count
&&
!
thd
->
killed
;
loop
++
)
{
switch
(
args
[
1
]
->
result_type
())
{
case
REAL_RESULT
:
...
...
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