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
c955e3bf
Commit
c955e3bf
authored
Jan 04, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for different int sizes in condition pushdown
parent
2a7bf81e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
27 deletions
+93
-27
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+88
-27
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+5
-0
No files found.
sql/ha_ndbcluster.cc
View file @
c955e3bf
...
...
@@ -5554,8 +5554,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
{
// Currently only support for unsigned int
if
(
field
->
result_type
()
==
INT_RESULT
&&
(
field
->
type
()
!=
MYSQL_TYPE_LONG
||
!
(
field
->
flags
&
UNSIGNED_FLAG
)))
!
(
field
->
flags
&
UNSIGNED_FLAG
))
*
context
->
supported_ptr
=
FALSE
;
else
{
...
...
@@ -5778,9 +5777,14 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
(
b
->
type
==
NDB_FIELD
)
?
b
:
NULL
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating EQ filter"
));
filter
->
eq
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
DBUG_PRINT
(
"info"
,
(
"Generating EQ filter %s"
,
field
->
isBig
()
?
"64 bit"
:
""
));
if
(
field
->
isBig
())
filter
->
eq
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
eq
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
case
(
Item_func
:
:
NE_FUNC
)
:
{
...
...
@@ -5796,9 +5800,14 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
(
b
->
type
==
NDB_FIELD
)
?
b
:
NULL
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating NE filter"
));
filter
->
ne
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
DBUG_PRINT
(
"info"
,
(
"Generating NE filter %s"
,
field
->
isBig
()
?
"64 bit"
:
""
));
if
(
field
->
isBig
())
filter
->
ne
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
ne
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
case
(
Item_func
:
:
LT_FUNC
)
:
{
...
...
@@ -5814,13 +5823,26 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
(
b
->
type
==
NDB_FIELD
)
?
b
:
NULL
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating LT filter"
));
DBUG_PRINT
(
"info"
,
(
"Generating LT filter %s"
,
field
->
isBig
()
?
"64 bit"
:
""
));
if
(
a
==
field
)
filter
->
lt
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
{
if
(
field
->
isBig
())
filter
->
lt
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
lt
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
}
else
filter
->
gt
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
{
if
(
field
->
isBig
())
filter
->
gt
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
gt
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
case
(
Item_func
:
:
LE_FUNC
)
:
{
...
...
@@ -5836,13 +5858,26 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
(
b
->
type
==
NDB_FIELD
)
?
b
:
NULL
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating LE filter"
));
DBUG_PRINT
(
"info"
,
(
"Generating LE filter %s"
,
field
->
isBig
()
?
"64 bit"
:
""
));
if
(
a
==
field
)
filter
->
le
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
{
if
(
field
->
isBig
())
filter
->
le
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
le
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
}
else
filter
->
ge
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
{
if
(
field
->
isBig
())
filter
->
ge
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
ge
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
case
(
Item_func
:
:
GE_FUNC
)
:
{
...
...
@@ -5858,13 +5893,26 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
(
b
->
type
==
NDB_FIELD
)
?
b
:
NULL
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating GE filter"
));
DBUG_PRINT
(
"info"
,
(
"Generating GE filter %s"
,
field
->
isBig
()
?
"64 bit"
:
""
));
if
(
a
==
field
)
filter
->
ge
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
{
if
(
field
->
isBig
())
filter
->
ge
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
ge
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
}
else
filter
->
le
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
{
if
(
field
->
isBig
())
filter
->
le
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
le
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
case
(
Item_func
:
:
GT_FUNC
)
:
{
...
...
@@ -5880,13 +5928,26 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
(
b
->
type
==
NDB_FIELD
)
?
b
:
NULL
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating GT filter"
));
DBUG_PRINT
(
"info"
,
(
"Generating GT filter %s"
,
field
->
isBig
()
?
"64 bit"
:
""
));
if
(
a
==
field
)
filter
->
gt
(
field
->
getFieldNo
(),
{
if
(
field
->
isBig
())
filter
->
gt
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
gt
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
}
else
filter
->
lt
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
{
if
(
field
->
isBig
())
filter
->
lt
(
field
->
getFieldNo
(),
(
Uint64
)
value
->
getIntValue
());
else
filter
->
lt
(
field
->
getFieldNo
(),
(
Uint32
)
value
->
getIntValue
());
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
case
(
Item_func
:
:
LIKE_FUNC
)
:
{
...
...
sql/ha_ndbcluster.h
View file @
c955e3bf
...
...
@@ -103,6 +103,11 @@ class Ndb_item {
Ndb_item
(
Item_func
::
Functype
func_type
);
~
Ndb_item
();
void
print
(
String
*
str
);
bool
isBig
()
{
enum_field_types
type
=
value
.
field_value
->
field
->
type
();
return
(
type
==
MYSQL_TYPE_LONGLONG
||
type
==
MYSQL_TYPE_INT24
);
}
// Getters and Setters
longlong
getIntValue
()
{
return
value
.
int_value
;
};
double
getRealValue
()
{
return
value
.
real_value
;
};
...
...
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