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
0d72625c
Commit
0d72625c
authored
Jan 04, 2005
by
mskold@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for different int sizes in condition pushdown
parent
7a262068
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
78 deletions
+58
-78
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+58
-73
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+0
-5
No files found.
sql/ha_ndbcluster.cc
View file @
0d72625c
...
...
@@ -5777,14 +5777,13 @@ 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 %s"
,
field
->
is_big
()
?
"64 bit"
:
""
));
if
(
field
->
is_big
())
filter
->
eq
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
eq
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
DBUG_PRINT
(
"info"
,
(
"Generating EQ filter"
));
longlong
int_value
=
value
->
get_int_value
();
filter
->
cmp
(
NdbScanFilter
::
COND_EQ
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
case
(
Item_func
:
:
NE_FUNC
)
:
{
...
...
@@ -5800,15 +5799,13 @@ 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 %s"
,
field
->
is_big
()
?
"64 bit"
:
""
));
if
(
field
->
is_big
())
filter
->
ne
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
ne
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
(),
field
->
pack_length
());
DBUG_PRINT
(
"info"
,
(
"Generating NE filter"
));
longlong
int_value
=
value
->
get_int_value
();
filter
->
cmp
(
NdbScanFilter
::
COND_NE
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
case
(
Item_func
:
:
LT_FUNC
)
:
{
...
...
@@ -5824,25 +5821,22 @@ 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 %s"
,
field
->
is_big
()
?
"64 bit"
:
""
));
DBUG_PRINT
(
"info"
,
(
"Generating LT filter"
));
longlong
int_value
=
value
->
get_int_value
();
if
(
a
==
field
)
{
if
(
field
->
is_big
())
filter
->
lt
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
lt
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
filter
->
cmp
(
NdbScanFilter
::
COND_LT
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
}
else
{
if
(
field
->
is_big
())
filter
->
gt
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
gt
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
filter
->
cmp
(
NdbScanFilter
::
COND_GT
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
...
...
@@ -5859,25 +5853,22 @@ 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 %s"
,
field
->
is_big
()
?
"64 bit"
:
""
));
DBUG_PRINT
(
"info"
,
(
"Generating LE filter"
));
longlong
int_value
=
value
->
get_int_value
();
if
(
a
==
field
)
{
if
(
field
->
is_big
())
filter
->
le
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
le
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
filter
->
cmp
(
NdbScanFilter
::
COND_LE
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
}
else
{
if
(
field
->
is_big
())
filter
->
ge
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
ge
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
filter
->
cmp
(
NdbScanFilter
::
COND_GE
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
...
...
@@ -5894,25 +5885,22 @@ 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 %s"
,
field
->
is_big
()
?
"64 bit"
:
""
));
DBUG_PRINT
(
"info"
,
(
"Generating GE filter"
));
longlong
int_value
=
value
->
get_int_value
();
if
(
a
==
field
)
{
if
(
field
->
is_big
())
filter
->
ge
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
ge
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
filter
->
cmp
(
NdbScanFilter
::
COND_GE
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
}
else
{
if
(
field
->
is_big
())
filter
->
le
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
le
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
filter
->
cmp
(
NdbScanFilter
::
COND_LE
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
...
...
@@ -5929,25 +5917,22 @@ 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 %s"
,
field
->
is_big
()
?
"64 bit"
:
""
));
DBUG_PRINT
(
"info"
,
(
"Generating GT filter"
));
longlong
int_value
=
value
->
get_int_value
();
if
(
a
==
field
)
{
if
(
field
->
is_big
())
filter
->
gt
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
gt
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
filter
->
cmp
(
NdbScanFilter
::
COND_GT
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
}
else
{
if
(
field
->
is_big
())
filter
->
lt
(
field
->
get_field_no
(),
(
Uint64
)
value
->
get_int_value
());
else
filter
->
lt
(
field
->
get_field_no
(),
(
Uint32
)
value
->
get_int_value
());
filter
->
cmp
(
NdbScanFilter
::
COND_LT
,
field
->
get_field_no
(),
(
void
*
)
&
int_value
,
field
->
pack_length
());
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
...
...
sql/ha_ndbcluster.h
View file @
0d72625c
...
...
@@ -103,11 +103,6 @@ class Ndb_item {
Ndb_item
(
Item_func
::
Functype
func_type
);
~
Ndb_item
();
void
print
(
String
*
str
);
bool
is_big
()
{
enum_field_types
type
=
value
.
field_value
->
field
->
type
();
return
(
type
==
MYSQL_TYPE_LONGLONG
||
type
==
MYSQL_TYPE_INT24
);
};
uint32
pack_length
()
{
return
value
.
field_value
->
field
->
pack_length
();
};
// Getters and Setters
longlong
get_int_value
()
{
return
value
.
int_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