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
e52fde67
Commit
e52fde67
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
ed79f588
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
72 deletions
+74
-72
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+65
-64
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+9
-8
No files found.
sql/ha_ndbcluster.cc
View file @
e52fde67
...
@@ -5778,13 +5778,13 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
...
@@ -5778,13 +5778,13 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
NULL
;
:
NULL
;
if
(
!
value
||
!
field
)
break
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating EQ filter %s"
,
DBUG_PRINT
(
"info"
,
(
"Generating EQ filter %s"
,
field
->
is
B
ig
()
?
"64 bit"
:
""
));
field
->
is
_b
ig
()
?
"64 bit"
:
""
));
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
eq
(
field
->
get
FieldN
o
(),
filter
->
eq
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
eq
(
field
->
get
FieldN
o
(),
filter
->
eq
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
}
case
(
Item_func
:
:
NE_FUNC
)
:
{
case
(
Item_func
:
:
NE_FUNC
)
:
{
...
@@ -5801,13 +5801,14 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
...
@@ -5801,13 +5801,14 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
NULL
;
:
NULL
;
if
(
!
value
||
!
field
)
break
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating NE filter %s"
,
DBUG_PRINT
(
"info"
,
(
"Generating NE filter %s"
,
field
->
is
B
ig
()
?
"64 bit"
:
""
));
field
->
is
_b
ig
()
?
"64 bit"
:
""
));
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
ne
(
field
->
get
FieldN
o
(),
filter
->
ne
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
ne
(
field
->
getFieldNo
(),
filter
->
ne
(
field
->
get_field_no
(),
(
Uint32
)
value
->
getIntValue
());
(
Uint32
)
value
->
get_int_value
(),
field
->
pack_length
());
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
}
case
(
Item_func
:
:
LT_FUNC
)
:
{
case
(
Item_func
:
:
LT_FUNC
)
:
{
...
@@ -5824,24 +5825,24 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
...
@@ -5824,24 +5825,24 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
NULL
;
:
NULL
;
if
(
!
value
||
!
field
)
break
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating LT filter %s"
,
DBUG_PRINT
(
"info"
,
(
"Generating LT filter %s"
,
field
->
is
B
ig
()
?
"64 bit"
:
""
));
field
->
is
_b
ig
()
?
"64 bit"
:
""
));
if
(
a
==
field
)
if
(
a
==
field
)
{
{
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
lt
(
field
->
get
FieldN
o
(),
filter
->
lt
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
lt
(
field
->
get
FieldN
o
(),
filter
->
lt
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
}
}
else
else
{
{
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
gt
(
field
->
get
FieldN
o
(),
filter
->
gt
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
gt
(
field
->
get
FieldN
o
(),
filter
->
gt
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
}
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
}
...
@@ -5859,24 +5860,24 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
...
@@ -5859,24 +5860,24 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
NULL
;
:
NULL
;
if
(
!
value
||
!
field
)
break
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating LE filter %s"
,
DBUG_PRINT
(
"info"
,
(
"Generating LE filter %s"
,
field
->
is
B
ig
()
?
"64 bit"
:
""
));
field
->
is
_b
ig
()
?
"64 bit"
:
""
));
if
(
a
==
field
)
if
(
a
==
field
)
{
{
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
le
(
field
->
get
FieldN
o
(),
filter
->
le
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
le
(
field
->
get
FieldN
o
(),
filter
->
le
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
}
}
else
else
{
{
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
ge
(
field
->
get
FieldN
o
(),
filter
->
ge
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
ge
(
field
->
get
FieldN
o
(),
filter
->
ge
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
}
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
}
...
@@ -5894,24 +5895,24 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
...
@@ -5894,24 +5895,24 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
NULL
;
:
NULL
;
if
(
!
value
||
!
field
)
break
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating GE filter %s"
,
DBUG_PRINT
(
"info"
,
(
"Generating GE filter %s"
,
field
->
is
B
ig
()
?
"64 bit"
:
""
));
field
->
is
_b
ig
()
?
"64 bit"
:
""
));
if
(
a
==
field
)
if
(
a
==
field
)
{
{
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
ge
(
field
->
get
FieldN
o
(),
filter
->
ge
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
ge
(
field
->
get
FieldN
o
(),
filter
->
ge
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
}
}
else
else
{
{
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
le
(
field
->
get
FieldN
o
(),
filter
->
le
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
le
(
field
->
get
FieldN
o
(),
filter
->
le
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
}
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
}
...
@@ -5929,24 +5930,24 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
...
@@ -5929,24 +5930,24 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
NULL
;
:
NULL
;
if
(
!
value
||
!
field
)
break
;
if
(
!
value
||
!
field
)
break
;
DBUG_PRINT
(
"info"
,
(
"Generating GT filter %s"
,
DBUG_PRINT
(
"info"
,
(
"Generating GT filter %s"
,
field
->
is
B
ig
()
?
"64 bit"
:
""
));
field
->
is
_b
ig
()
?
"64 bit"
:
""
));
if
(
a
==
field
)
if
(
a
==
field
)
{
{
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
gt
(
field
->
get
FieldN
o
(),
filter
->
gt
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
gt
(
field
->
get
FieldN
o
(),
filter
->
gt
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
}
}
else
else
{
{
if
(
field
->
is
B
ig
())
if
(
field
->
is
_b
ig
())
filter
->
lt
(
field
->
get
FieldN
o
(),
filter
->
lt
(
field
->
get
_field_n
o
(),
(
Uint64
)
value
->
get
IntV
alue
());
(
Uint64
)
value
->
get
_int_v
alue
());
else
else
filter
->
lt
(
field
->
get
FieldN
o
(),
filter
->
lt
(
field
->
get
_field_n
o
(),
(
Uint32
)
value
->
get
IntV
alue
());
(
Uint32
)
value
->
get
_int_v
alue
());
}
}
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
}
...
@@ -5964,9 +5965,9 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
...
@@ -5964,9 +5965,9 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
NULL
;
:
NULL
;
if
(
!
value
||
!
field
)
break
;
if
(
!
value
||
!
field
)
break
;
if
(
value
->
qualification
.
value_type
!=
Item
::
STRING_ITEM
)
break
;
if
(
value
->
qualification
.
value_type
!=
Item
::
STRING_ITEM
)
break
;
String
*
str
=
value
->
get
StringV
alue
();
String
*
str
=
value
->
get
_string_v
alue
();
DBUG_PRINT
(
"info"
,
(
"Generating LIKE filter: like(%d,%s,%d)"
,
field
->
get
FieldN
o
(),
str
->
ptr
(),
str
->
length
()));
DBUG_PRINT
(
"info"
,
(
"Generating LIKE filter: like(%d,%s,%d)"
,
field
->
get
_field_n
o
(),
str
->
ptr
(),
str
->
length
()));
//filter->like(field->get
FieldN
o(),
//filter->like(field->get
_field_n
o(),
// str->ptr(), str->length(), TRUE);
// str->ptr(), str->length(), TRUE);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
}
...
@@ -5984,22 +5985,22 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
...
@@ -5984,22 +5985,22 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond *cond,
:
NULL
;
:
NULL
;
if
(
!
value
||
!
field
)
break
;
if
(
!
value
||
!
field
)
break
;
if
(
value
->
qualification
.
value_type
!=
Item
::
STRING_ITEM
)
break
;
if
(
value
->
qualification
.
value_type
!=
Item
::
STRING_ITEM
)
break
;
String
*
str
=
value
->
get
StringV
alue
();
String
*
str
=
value
->
get
_string_v
alue
();
DBUG_PRINT
(
"info"
,
(
"Generating NOTLIKE filter: notlike(%d,%s,%d)"
,
field
->
get
FieldN
o
(),
str
->
ptr
(),
str
->
length
()));
DBUG_PRINT
(
"info"
,
(
"Generating NOTLIKE filter: notlike(%d,%s,%d)"
,
field
->
get
_field_n
o
(),
str
->
ptr
(),
str
->
length
()));
//filter->notlike(field->get
FieldN
o(),
//filter->notlike(field->get
_field_n
o(),
// str->ptr(), str->length());
// str->ptr(), str->length());
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
->
next
);
}
}
case
(
Item_func
:
:
ISNULL_FUNC
)
:
case
(
Item_func
:
:
ISNULL_FUNC
)
:
if
(
a
->
type
==
NDB_FIELD
)
{
if
(
a
->
type
==
NDB_FIELD
)
{
DBUG_PRINT
(
"info"
,
(
"Generating ISNULL filter"
));
DBUG_PRINT
(
"info"
,
(
"Generating ISNULL filter"
));
filter
->
isnull
(
a
->
get
FieldN
o
());
filter
->
isnull
(
a
->
get
_field_n
o
());
}
}
DBUG_RETURN
(
cond
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
);
case
(
Item_func
:
:
ISNOTNULL_FUNC
)
:
{
case
(
Item_func
:
:
ISNOTNULL_FUNC
)
:
{
if
(
a
->
type
==
NDB_FIELD
)
{
if
(
a
->
type
==
NDB_FIELD
)
{
DBUG_PRINT
(
"info"
,
(
"Generating ISNOTNULL filter"
));
DBUG_PRINT
(
"info"
,
(
"Generating ISNOTNULL filter"
));
filter
->
isnotnull
(
a
->
get
FieldN
o
());
filter
->
isnotnull
(
a
->
get
_field_n
o
());
}
}
DBUG_RETURN
(
cond
->
next
->
next
);
DBUG_RETURN
(
cond
->
next
->
next
);
}
}
...
...
sql/ha_ndbcluster.h
View file @
e52fde67
...
@@ -103,18 +103,19 @@ class Ndb_item {
...
@@ -103,18 +103,19 @@ class Ndb_item {
Ndb_item
(
Item_func
::
Functype
func_type
);
Ndb_item
(
Item_func
::
Functype
func_type
);
~
Ndb_item
();
~
Ndb_item
();
void
print
(
String
*
str
);
void
print
(
String
*
str
);
bool
is
B
ig
()
bool
is
_b
ig
()
{
{
enum_field_types
type
=
value
.
field_value
->
field
->
type
();
enum_field_types
type
=
value
.
field_value
->
field
->
type
();
return
(
type
==
MYSQL_TYPE_LONGLONG
||
type
==
MYSQL_TYPE_INT24
);
return
(
type
==
MYSQL_TYPE_LONGLONG
||
type
==
MYSQL_TYPE_INT24
);
}
};
uint32
pack_length
()
{
return
value
.
field_value
->
field
->
pack_length
();
};
// Getters and Setters
// Getters and Setters
longlong
get
IntV
alue
()
{
return
value
.
int_value
;
};
longlong
get
_int_v
alue
()
{
return
value
.
int_value
;
};
double
get
RealV
alue
()
{
return
value
.
real_value
;
};
double
get
_real_v
alue
()
{
return
value
.
real_value
;
};
String
*
get
StringV
alue
()
{
return
&
value
.
string_value
->
s
;
};
String
*
get
_string_v
alue
()
{
return
&
value
.
string_value
->
s
;
};
CHARSET_INFO
*
get
StringC
harset
()
{
return
value
.
string_value
->
c
;
};
CHARSET_INFO
*
get
_string_c
harset
()
{
return
value
.
string_value
->
c
;
};
Field
*
get
F
ield
()
{
return
value
.
field_value
->
field
;
};
Field
*
get
_f
ield
()
{
return
value
.
field_value
->
field
;
};
int
get
FieldN
o
()
{
return
value
.
field_value
->
column_no
;
};
int
get
_field_n
o
()
{
return
value
.
field_value
->
column_no
;
};
public:
public:
NDB_ITEM_TYPE
type
;
NDB_ITEM_TYPE
type
;
...
...
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