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