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
4ceaf3a6
Commit
4ceaf3a6
authored
Apr 07, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct handling of parameter variables with NULL values in PREPARE queries
parent
fbfdff7f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
mysql-test/r/ps.result
mysql-test/r/ps.result
+9
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+4
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+4
-2
No files found.
mysql-test/r/ps.result
View file @
4ceaf3a6
...
...
@@ -66,6 +66,7 @@ NULL
NULL
NULL
NULL
set @nullvar=1;
set @nullvar=NULL;
execute stmt5 using @nullvar;
? + a
...
...
@@ -74,4 +75,12 @@ NULL
NULL
NULL
NULL
set @nullvar2=NULL;
execute stmt5 using @nullvar2;
? + a
NULL
NULL
NULL
NULL
NULL
drop table t1;
mysql-test/t/ps.test
View file @
4ceaf3a6
...
...
@@ -68,8 +68,12 @@ execute stmt5 using @a;
execute
stmt5
using
@
no_such_var
;
set
@
nullvar
=
1
;
set
@
nullvar
=
NULL
;
execute
stmt5
using
@
nullvar
;
set
@
nullvar2
=
NULL
;
execute
stmt5
using
@
nullvar2
;
drop
table
t1
;
sql/sql_prepare.cc
View file @
4ceaf3a6
...
...
@@ -661,7 +661,8 @@ static bool insert_params_from_vars(Prepared_statement *stmt,
varname
=
var_it
++
;
if
((
entry
=
(
user_var_entry
*
)
hash_search
(
&
stmt
->
thd
->
user_vars
,
(
byte
*
)
varname
->
str
,
varname
->
length
)))
varname
->
length
))
&&
entry
->
value
)
{
param
->
item_result_type
=
entry
->
type
;
switch
(
entry
->
type
)
...
...
@@ -710,7 +711,8 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
varname
=
var_it
++
;
if
((
entry
=
(
user_var_entry
*
)
hash_search
(
&
stmt
->
thd
->
user_vars
,
(
byte
*
)
varname
->
str
,
varname
->
length
)))
varname
->
length
))
&&
entry
->
value
)
{
param
->
item_result_type
=
entry
->
type
;
switch
(
entry
->
type
)
...
...
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