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
a5c8b3ee
Commit
a5c8b3ee
authored
Jun 26, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct eq() method for Item_param (BUG#4233)
parent
c4004aec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
mysql-test/r/ps.result
mysql-test/r/ps.result
+17
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+15
-0
sql/item.h
sql/item.h
+2
-0
No files found.
mysql-test/r/ps.result
View file @
a5c8b3ee
...
...
@@ -191,4 +191,21 @@ execute stmt1 using @arg00;
select m from t1;
m
1
deallocate prepare stmt1;
drop table t1;
create table t1 (id int(10) unsigned NOT NULL default '0',
name varchar(64) NOT NULL default '',
PRIMARY KEY (id), UNIQUE KEY `name` (`name`));
insert into t1 values (1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7');
prepare stmt1 from 'select name from t1 where id=? or id=?';
set @id1=1,@id2=6;
execute stmt1 using @id1, @id2;
name
1
6
select name from t1 where id=1 or id=6;
name
1
6
deallocate prepare stmt1;
drop table t1;
mysql-test/t/ps.test
View file @
a5c8b3ee
...
...
@@ -178,4 +178,19 @@ drop table t1;
prepare
stmt1
from
' create table t1 (m int) as select ? as m '
;
execute
stmt1
using
@
arg00
;
select
m
from
t1
;
deallocate
prepare
stmt1
;
drop
table
t1
;
#
# eq() for parameters
#
create
table
t1
(
id
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
name
varchar
(
64
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
id
),
UNIQUE
KEY
`name`
(
`name`
));
insert
into
t1
values
(
1
,
'1'
),(
2
,
'2'
),(
3
,
'3'
),(
4
,
'4'
),(
5
,
'5'
),(
6
,
'6'
),(
7
,
'7'
);
prepare
stmt1
from
'select name from t1 where id=? or id=?'
;
set
@
id1
=
1
,
@
id2
=
6
;
execute
stmt1
using
@
id1
,
@
id2
;
select
name
from
t1
where
id
=
1
or
id
=
6
;
deallocate
prepare
stmt1
;
drop
table
t1
;
sql/item.h
View file @
a5c8b3ee
...
...
@@ -525,6 +525,8 @@ public:
virtual
table_map
used_tables
()
const
{
return
state
!=
NO_VALUE
?
(
table_map
)
0
:
PARAM_TABLE_BIT
;
}
void
print
(
String
*
str
)
{
str
->
append
(
'?'
);
}
/* parameter never equal to other parameter of other item */
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
{
return
0
;
}
};
class
Item_int
:
public
Item_num
...
...
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