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
c0317ce6
Commit
c0317ce6
authored
Aug 05, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make it clear for optimizer that XOR's are not optimizable at the moment (BUG#992)
parent
5ac7f31b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
mysql-test/r/func_test.result
mysql-test/r/func_test.result
+5
-0
mysql-test/t/func_test.test
mysql-test/t/func_test.test
+5
-0
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+8
-2
No files found.
mysql-test/r/func_test.result
View file @
c0317ce6
...
@@ -46,6 +46,11 @@ select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
...
@@ -46,6 +46,11 @@ select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
0 1 1 0 NULL NULL NULL
0 1 1 0 NULL NULL NULL
create table t1 (a int);
insert t1 values (1);
select * from t1 where 1 xor 1;
a
drop table t1;
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
0 1
0 1
...
...
mysql-test/t/func_test.test
View file @
c0317ce6
...
@@ -18,6 +18,11 @@ select -1.49 or -1.49,0.6 or 0.6;
...
@@ -18,6 +18,11 @@ select -1.49 or -1.49,0.6 or 0.6;
select
3
^
11
,
1
^
1
,
1
^
0
,
1
^
NULL
,
NULL
^
1
;
select
3
^
11
,
1
^
1
,
1
^
0
,
1
^
NULL
,
NULL
^
1
;
select
1
XOR
1
,
1
XOR
0
,
0
XOR
1
,
0
XOR
0
,
NULL
XOR
1
,
1
XOR
NULL
,
0
XOR
NULL
;
select
1
XOR
1
,
1
XOR
0
,
0
XOR
1
,
0
XOR
0
,
NULL
XOR
1
,
1
XOR
NULL
,
0
XOR
NULL
;
create
table
t1
(
a
int
);
insert
t1
values
(
1
);
select
*
from
t1
where
1
xor
1
;
drop
table
t1
;
#
#
# Wrong usage of functions
# Wrong usage of functions
#
#
...
...
sql/item_cmpfunc.h
View file @
c0317ce6
...
@@ -634,12 +634,18 @@ inline Item *and_conds(Item *a,Item *b)
...
@@ -634,12 +634,18 @@ inline Item *and_conds(Item *a,Item *b)
return
cond
;
return
cond
;
}
}
/*
XOR is Item_cond, not an Item_int_func bevause we could like to
optimize (a XOR b) later on. It's low prio, though
*/
class
Item_cond_xor
:
public
Item_cond
class
Item_cond_xor
:
public
Item_cond
{
{
public:
public:
Item_cond_xor
()
:
Item_cond
()
{}
Item_cond_xor
()
:
Item_cond
()
{}
Item_cond_xor
(
Item
*
i1
,
Item
*
i2
)
:
Item_cond
(
i1
,
i2
)
{}
Item_cond_xor
(
Item
*
i1
,
Item
*
i2
)
:
Item_cond
(
i1
,
i2
)
{}
enum
Functype
functype
()
const
{
return
COND_XOR_FUNC
;
}
enum
Functype
functype
()
const
{
return
COND_XOR_FUNC
;
}
/* TODO: remove the next line when implementing XOR optimization */
enum
Type
type
()
const
{
return
FUNC_ITEM
;
}
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"xor"
;
}
const
char
*
func_name
()
const
{
return
"xor"
;
}
};
};
...
...
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