Bug #6297 prepared statement, wrong handling of <parameter> IS NULL

Submitted: 28 Oct 2004 9:07 Modified: 19 Dec 2004 17:51
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1 OS:
Assigned to: Konstantin Osipov CPU Architecture:Any

[28 Oct 2004 9:07] Matthias Leich
Description:
Please have a look on the following protocol output:

set @var_x= 'ABC';
set @var_x= NULL;
prepare __stmt_ph_ from "select 'blabla' as my_column 
                         from (select 1) as t1 where ? IS NULL" ;
execute __stmt_ph_ using @var_x ;
my_column                          # <-- I expect here one row containing 'blabla'   !!                                       
# The following statements are for comparison
select 'blabla' as my_column 
from (select 1) as t1 where NULL IS NULL ;
my_column
blabla                                  # <- Here is the row I expect
select 'blabla' as my_column 
from (select 1) as t1 where @var_x IS NULL ;
my_column
blabla                                  # <- Here is the row I expect                                                     
prepare __stmt_uv_ from "select 'blabla' as my_column 
                         from (select 1) as t1 where @var_x IS NULL" ;
execute __stmt_uv_ ;
my_column
blabla                                  # <- Here is the row I expect

My environment:
   - Intel PC with Linux(SuSE 9.1)
   - MySQL 4.1 compiled from source
        last ChangeSet@1.2061, 2004-10-28

How to repeat:
How to repeat:
Please use my test file, copy it to mysql-test/t
  ./mysql-test-run ml_err35
[28 Oct 2004 9:08] Matthias Leich
test case

Attachment: ml_err35.test (application/octet-stream, text), 591 bytes.

[3 Nov 2004 21:05] Konstantin Osipov
Subject: bk commit - 4.1 tree (konstantin:1.2078) BUG#6297

ChangeSet
  1.2078 04/11/04 00:03:28 konstantin@mysql.com +3 -0
  A fix and test case for Bug#6297 "prepared statement, wrong handling
   of <parameter> IS NULL":
  we must not only set Item::null_value in Item_param, but implement
  Item_param::is_null() to work well with IS NULL/IS NOT NULL clauses.
[19 Dec 2004 17:51] Konstantin Osipov
Fixed in 4.1.8

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.