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
f8d524cd
Commit
f8d524cd
authored
Apr 07, 2006
by
joerg@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/M41/mtr-4.1
parents
657d1bd1
15b59156
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
3 deletions
+54
-3
mysql-test/r/ps.result
mysql-test/r/ps.result
+20
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+18
-0
sql/item_row.cc
sql/item_row.cc
+15
-1
sql/item_row.h
sql/item_row.h
+1
-2
No files found.
mysql-test/r/ps.result
View file @
f8d524cd
...
@@ -747,3 +747,23 @@ length(a)
...
@@ -747,3 +747,23 @@ length(a)
10
10
drop table t1;
drop table t1;
deallocate prepare stmt;
deallocate prepare stmt;
create table t1 (col1 integer, col2 integer);
insert into t1 values(100,100),(101,101),(102,102),(103,103);
prepare stmt from 'select col1, col2 from t1 where (col1, col2) in ((?,?))';
set @a=100, @b=100;
execute stmt using @a,@b;
col1 col2
100 100
set @a=101, @b=101;
execute stmt using @a,@b;
col1 col2
101 101
set @a=102, @b=102;
execute stmt using @a,@b;
col1 col2
102 102
set @a=102, @b=103;
execute stmt using @a,@b;
col1 col2
deallocate prepare stmt;
drop table t1;
mysql-test/t/ps.test
View file @
f8d524cd
...
@@ -785,4 +785,22 @@ select length(a) from t1;
...
@@ -785,4 +785,22 @@ select length(a) from t1;
drop
table
t1
;
drop
table
t1
;
deallocate
prepare
stmt
;
deallocate
prepare
stmt
;
#
# Bug#16248 "WHERE (col1,col2) IN ((?,?)) gives wrong results":
# check that ROW implementation is reexecution-friendly.
#
create
table
t1
(
col1
integer
,
col2
integer
);
insert
into
t1
values
(
100
,
100
),(
101
,
101
),(
102
,
102
),(
103
,
103
);
prepare
stmt
from
'select col1, col2 from t1 where (col1, col2) in ((?,?))'
;
set
@
a
=
100
,
@
b
=
100
;
execute
stmt
using
@
a
,
@
b
;
set
@
a
=
101
,
@
b
=
101
;
execute
stmt
using
@
a
,
@
b
;
set
@
a
=
102
,
@
b
=
102
;
execute
stmt
using
@
a
,
@
b
;
set
@
a
=
102
,
@
b
=
103
;
execute
stmt
using
@
a
,
@
b
;
deallocate
prepare
stmt
;
drop
table
t1
;
# End of 4.1 tests
# End of 4.1 tests
sql/item_row.cc
View file @
f8d524cd
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
*/
*/
Item_row
::
Item_row
(
List
<
Item
>
&
arg
)
:
Item_row
::
Item_row
(
List
<
Item
>
&
arg
)
:
Item
(),
used_tables_cache
(
0
),
array_holder
(
1
),
const_item_cache
(
1
),
with_null
(
0
)
Item
(),
used_tables_cache
(
0
),
const_item_cache
(
1
),
with_null
(
0
)
{
{
//TODO: think placing 2-3 component items in item (as it done for function)
//TODO: think placing 2-3 component items in item (as it done for function)
...
@@ -85,6 +85,20 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref)
...
@@ -85,6 +85,20 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref)
}
}
void
Item_row
::
cleanup
()
{
DBUG_ENTER
(
"Item_row::cleanup"
);
Item
::
cleanup
();
/* Reset to the original values */
used_tables_cache
=
0
;
const_item_cache
=
1
;
with_null
=
0
;
DBUG_VOID_RETURN
;
}
void
Item_row
::
split_sum_func
(
THD
*
thd
,
Item
**
ref_pointer_array
,
void
Item_row
::
split_sum_func
(
THD
*
thd
,
Item
**
ref_pointer_array
,
List
<
Item
>
&
fields
)
List
<
Item
>
&
fields
)
{
{
...
...
sql/item_row.h
View file @
f8d524cd
...
@@ -19,7 +19,6 @@ class Item_row: public Item
...
@@ -19,7 +19,6 @@ class Item_row: public Item
Item
**
items
;
Item
**
items
;
table_map
used_tables_cache
;
table_map
used_tables_cache
;
uint
arg_count
;
uint
arg_count
;
bool
array_holder
;
bool
const_item_cache
;
bool
const_item_cache
;
bool
with_null
;
bool
with_null
;
public:
public:
...
@@ -29,7 +28,6 @@ class Item_row: public Item
...
@@ -29,7 +28,6 @@ class Item_row: public Item
items
(
item
->
items
),
items
(
item
->
items
),
used_tables_cache
(
item
->
used_tables_cache
),
used_tables_cache
(
item
->
used_tables_cache
),
arg_count
(
item
->
arg_count
),
arg_count
(
item
->
arg_count
),
array_holder
(
0
),
const_item_cache
(
item
->
const_item_cache
),
const_item_cache
(
item
->
const_item_cache
),
with_null
(
0
)
with_null
(
0
)
{}
{}
...
@@ -57,6 +55,7 @@ class Item_row: public Item
...
@@ -57,6 +55,7 @@ class Item_row: public Item
return
0
;
return
0
;
};
};
bool
fix_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
Item
**
ref
);
bool
fix_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
Item
**
ref
);
void
cleanup
();
void
split_sum_func
(
THD
*
thd
,
Item
**
ref_pointer_array
,
List
<
Item
>
&
fields
);
void
split_sum_func
(
THD
*
thd
,
Item
**
ref_pointer_array
,
List
<
Item
>
&
fields
);
table_map
used_tables
()
const
{
return
used_tables_cache
;
};
table_map
used_tables
()
const
{
return
used_tables_cache
;
};
bool
const_item
()
const
{
return
const_item_cache
;
};
bool
const_item
()
const
{
return
const_item_cache
;
};
...
...
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