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
5cd4ba4e
Commit
5cd4ba4e
authored
Jan 09, 2007
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug25027
parents
0fa12d24
8642d23b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
4 deletions
+18
-4
mysql-test/r/ps.result
mysql-test/r/ps.result
+7
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+5
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+3
-3
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+2
-1
sql/sql_lex.cc
sql/sql_lex.cc
+1
-0
No files found.
mysql-test/r/ps.result
View file @
5cd4ba4e
...
...
@@ -1528,5 +1528,12 @@ a
1
2
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM 'SELECT a FROM t1 WHERE (SELECT b FROM t2 limit ?) IS NULL';
SET @arg=1;
EXECUTE stmt USING @arg;
a
1
2
DEALLOCATE PREPARE stmt;
DROP TABLE t1,t2;
End of 5.0 tests.
mysql-test/t/ps.test
View file @
5cd4ba4e
...
...
@@ -1577,8 +1577,13 @@ SELECT a FROM t1 WHERE (SELECT b FROM t2) IS NULL;
PREPARE
stmt
FROM
'SELECT a FROM t1 WHERE (SELECT b FROM t2) IS NULL'
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
PREPARE
stmt
FROM
'SELECT a FROM t1 WHERE (SELECT b FROM t2 limit ?) IS NULL'
;
SET
@
arg
=
1
;
EXECUTE
stmt
USING
@
arg
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.0
tests
.
sql/item_cmpfunc.cc
View file @
5cd4ba4e
...
...
@@ -2989,7 +2989,7 @@ longlong Item_func_isnull::val_int()
Handle optimization if the argument can't be null
This has to be here because of the test in update_used_tables().
*/
if
(
!
used_tables_cache
)
if
(
!
used_tables_cache
&&
!
with_subselect
)
return
cached_value
;
return
args
[
0
]
->
is_null
()
?
1
:
0
;
}
...
...
@@ -2998,7 +2998,7 @@ longlong Item_is_not_null_test::val_int()
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ENTER
(
"Item_is_not_null_test::val_int"
);
if
(
!
used_tables_cache
)
if
(
!
used_tables_cache
&&
!
with_subselect
)
{
owner
->
was_null
|=
(
!
cached_value
);
DBUG_PRINT
(
"info"
,
(
"cached :%ld"
,
(
long
)
cached_value
));
...
...
@@ -3025,7 +3025,7 @@ void Item_is_not_null_test::update_used_tables()
else
{
args
[
0
]
->
update_used_tables
();
if
(
!
(
used_tables_cache
=
args
[
0
]
->
used_tables
()))
if
(
!
(
used_tables_cache
=
args
[
0
]
->
used_tables
())
&&
!
with_subselect
)
{
/* Remember if the value is always NULL or never NULL */
cached_value
=
(
longlong
)
!
args
[
0
]
->
is_null
();
...
...
sql/item_cmpfunc.h
View file @
5cd4ba4e
...
...
@@ -1027,7 +1027,8 @@ class Item_func_isnull :public Item_bool_func
else
{
args
[
0
]
->
update_used_tables
();
if
((
const_item_cache
=
!
(
used_tables_cache
=
args
[
0
]
->
used_tables
())))
if
((
const_item_cache
=
!
(
used_tables_cache
=
args
[
0
]
->
used_tables
()))
&&
!
with_subselect
)
{
/* Remember if the value is always NULL or never NULL */
cached_value
=
(
longlong
)
args
[
0
]
->
is_null
();
...
...
sql/sql_lex.cc
View file @
5cd4ba4e
...
...
@@ -1902,6 +1902,7 @@ void st_select_lex_unit::set_limit(SELECT_LEX *sl)
{
ha_rows
select_limit_val
;
DBUG_ASSERT
(
!
thd
->
stmt_arena
->
is_stmt_prepare
());
select_limit_val
=
(
ha_rows
)(
sl
->
select_limit
?
sl
->
select_limit
->
val_uint
()
:
HA_POS_ERROR
);
offset_limit_cnt
=
(
ha_rows
)(
sl
->
offset_limit
?
sl
->
offset_limit
->
val_uint
()
:
...
...
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