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
cc57252b
Commit
cc57252b
authored
Oct 12, 2004
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ps.test, ps.result: a test case for Bug#6042 "constants
propogation works only once (prepared statements)".
parent
ae8800d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
mysql-test/r/ps.result
mysql-test/r/ps.result
+18
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+21
-0
No files found.
mysql-test/r/ps.result
View file @
cc57252b
...
...
@@ -318,3 +318,21 @@ execute stmt;
a
drop table t1;
deallocate prepare stmt;
create table t1 (a int, b int);
insert into t1 (a, b) values (1,1), (1,2), (2,1), (2,2);
prepare stmt from
"explain select * from t1 where t1.a=2 and t1.a=t1.b and t1.b > 1 + ?";
set @v=5;
execute stmt using @v;
id select_type table type possible_keys key key_len ref rows Extra
- - - - - - - - NULL Impossible WHERE
set @v=0;
execute stmt using @v;
id select_type table type possible_keys key key_len ref rows Extra
- - - - - - - - 4 Using where
set @v=5;
execute stmt using @v;
id select_type table type possible_keys key key_len ref rows Extra
- - - - - - - - NULL Impossible WHERE
drop table t1;
deallocate prepare stmt;
mysql-test/t/ps.test
View file @
cc57252b
...
...
@@ -342,4 +342,25 @@ execute stmt;
drop
table
t1
;
deallocate
prepare
stmt
;
#
# Test case for Bug#6042 "constants propogation works only once (prepared
# statements): check that the query plan changes whenever we change
# placeholder value.
#
create
table
t1
(
a
int
,
b
int
);
insert
into
t1
(
a
,
b
)
values
(
1
,
1
),
(
1
,
2
),
(
2
,
1
),
(
2
,
2
);
prepare
stmt
from
"explain select * from t1 where t1.a=2 and t1.a=t1.b and t1.b > 1 + ?"
;
--
replace_column
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
set
@
v
=
5
;
execute
stmt
using
@
v
;
--
replace_column
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
set
@
v
=
0
;
execute
stmt
using
@
v
;
--
replace_column
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
set
@
v
=
5
;
execute
stmt
using
@
v
;
drop
table
t1
;
deallocate
prepare
stmt
;
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