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
b67f82d9
Commit
b67f82d9
authored
Feb 24, 2005
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - wl-1203 fix binary LIKE binary in ndb api
parent
07cdc9e3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
13 deletions
+40
-13
mysql-test/r/ndb_condition_pushdown.result
mysql-test/r/ndb_condition_pushdown.result
+6
-2
mysql-test/t/ndb_condition_pushdown.test
mysql-test/t/ndb_condition_pushdown.test
+6
-2
ndb/src/ndbapi/NdbDictionaryImpl.hpp
ndb/src/ndbapi/NdbDictionaryImpl.hpp
+13
-0
ndb/src/ndbapi/NdbOperationInt.cpp
ndb/src/ndbapi/NdbOperationInt.cpp
+13
-7
ndb/src/ndbapi/NdbScanFilter.cpp
ndb/src/ndbapi/NdbScanFilter.cpp
+2
-2
No files found.
mysql-test/r/ndb_condition_pushdown.result
View file @
b67f82d9
...
@@ -235,13 +235,17 @@ auto
...
@@ -235,13 +235,17 @@ auto
4
4
select auto from t1 where
select auto from t1 where
string like "b%" and
string like "b%" and
vstring like "b%"
vstring like "b%" and
bin like concat(0xBB, '%') and
vbin like concat(0xBB, '%')
order by auto;
order by auto;
auto
auto
2
2
select auto from t1 where
select auto from t1 where
string not like "b%" and
string not like "b%" and
vstring not like "b%"
vstring not like "b%" and
bin not like concat(0xBB, '%') and
vbin not like concat(0xBB, '%')
order by auto;
order by auto;
auto
auto
1
1
...
...
mysql-test/t/ndb_condition_pushdown.test
View file @
b67f82d9
...
@@ -236,12 +236,16 @@ order by auto;
...
@@ -236,12 +236,16 @@ order by auto;
# Test LIKE/NOT LIKE
# Test LIKE/NOT LIKE
select
auto
from
t1
where
select
auto
from
t1
where
string
like
"b%"
and
string
like
"b%"
and
vstring
like
"b%"
vstring
like
"b%"
and
bin
like
concat
(
0xBB
,
'%'
)
and
vbin
like
concat
(
0xBB
,
'%'
)
order
by
auto
;
order
by
auto
;
select
auto
from
t1
where
select
auto
from
t1
where
string
not
like
"b%"
and
string
not
like
"b%"
and
vstring
not
like
"b%"
vstring
not
like
"b%"
and
bin
not
like
concat
(
0xBB
,
'%'
)
and
vbin
not
like
concat
(
0xBB
,
'%'
)
order
by
auto
;
order
by
auto
;
# Various tests
# Various tests
...
...
ndb/src/ndbapi/NdbDictionaryImpl.hpp
View file @
b67f82d9
...
@@ -76,8 +76,10 @@ public:
...
@@ -76,8 +76,10 @@ public:
Uint32
m_attrSize
;
// element size (size when arraySize==1)
Uint32
m_attrSize
;
// element size (size when arraySize==1)
Uint32
m_arraySize
;
// length or length+2 for Var* types
Uint32
m_arraySize
;
// length or length+2 for Var* types
Uint32
m_keyInfoPos
;
Uint32
m_keyInfoPos
;
// TODO: use bits in attr desc 2
bool
getInterpretableType
()
const
;
bool
getInterpretableType
()
const
;
bool
getCharType
()
const
;
bool
getCharType
()
const
;
bool
getStringType
()
const
;
bool
getBlobType
()
const
;
bool
getBlobType
()
const
;
/**
/**
...
@@ -468,6 +470,17 @@ NdbColumnImpl::getCharType() const {
...
@@ -468,6 +470,17 @@ NdbColumnImpl::getCharType() const {
m_type
==
NdbDictionary
::
Column
::
Text
||
m_type
==
NdbDictionary
::
Column
::
Text
||
m_type
==
NdbDictionary
::
Column
::
Longvarchar
);
m_type
==
NdbDictionary
::
Column
::
Longvarchar
);
}
}
inline
bool
NdbColumnImpl
::
getStringType
()
const
{
return
(
m_type
==
NdbDictionary
::
Column
::
Char
||
m_type
==
NdbDictionary
::
Column
::
Varchar
||
m_type
==
NdbDictionary
::
Column
::
Longvarchar
||
m_type
==
NdbDictionary
::
Column
::
Binary
||
m_type
==
NdbDictionary
::
Column
::
Varbinary
||
m_type
==
NdbDictionary
::
Column
::
Longvarbinary
);
}
inline
inline
bool
bool
...
...
ndb/src/ndbapi/NdbOperationInt.cpp
View file @
b67f82d9
...
@@ -1014,8 +1014,14 @@ NdbOperation::branch_col(Uint32 type,
...
@@ -1014,8 +1014,14 @@ NdbOperation::branch_col(Uint32 type,
Uint32
ColId
,
const
void
*
val
,
Uint32
len
,
Uint32
ColId
,
const
void
*
val
,
Uint32
len
,
bool
nopad
,
Uint32
Label
){
bool
nopad
,
Uint32
Label
){
DBUG_ENTER
(
"NdbOperation::branch_col"
);
DBUG_PRINT
(
"enter"
,
(
"type=%u col=%u val=0x%x len=%u label=%u"
,
type
,
ColId
,
val
,
len
,
Label
));
if
(
val
!=
NULL
)
DBUG_DUMP
(
"value"
,
(
char
*
)
val
,
len
);
if
(
initial_interpreterCheck
()
==
-
1
)
if
(
initial_interpreterCheck
()
==
-
1
)
return
-
1
;
DBUG_RETURN
(
-
1
)
;
Interpreter
::
BinaryCondition
c
=
(
Interpreter
::
BinaryCondition
)
type
;
Interpreter
::
BinaryCondition
c
=
(
Interpreter
::
BinaryCondition
)
type
;
...
@@ -1029,26 +1035,26 @@ NdbOperation::branch_col(Uint32 type,
...
@@ -1029,26 +1035,26 @@ NdbOperation::branch_col(Uint32 type,
if
(
val
==
NULL
)
if
(
val
==
NULL
)
len
=
0
;
len
=
0
;
else
{
else
{
if
(
!
col
->
get
Char
Type
())
{
if
(
!
col
->
get
String
Type
())
{
// prevent assert in NdbSqlUtil on length error
// prevent assert in NdbSqlUtil on length error
Uint32
sizeInBytes
=
col
->
m_attrSize
*
col
->
m_arraySize
;
Uint32
sizeInBytes
=
col
->
m_attrSize
*
col
->
m_arraySize
;
if
(
len
!=
0
&&
len
!=
sizeInBytes
)
if
(
len
!=
0
&&
len
!=
sizeInBytes
)
{
{
setErrorCodeAbort
(
4209
);
setErrorCodeAbort
(
4209
);
return
-
1
;
DBUG_RETURN
(
-
1
)
;
}
}
len
=
sizeInBytes
;
len
=
sizeInBytes
;
}
}
}
}
if
(
insertATTRINFO
(
Interpreter
::
BranchCol
(
c
,
0
,
0
,
false
))
==
-
1
)
if
(
insertATTRINFO
(
Interpreter
::
BranchCol
(
c
,
0
,
0
,
false
))
==
-
1
)
return
-
1
;
DBUG_RETURN
(
-
1
)
;
if
(
insertBranch
(
Label
)
==
-
1
)
if
(
insertBranch
(
Label
)
==
-
1
)
return
-
1
;
DBUG_RETURN
(
-
1
)
;
if
(
insertATTRINFO
(
Interpreter
::
BranchCol_2
(
ColId
,
len
)))
if
(
insertATTRINFO
(
Interpreter
::
BranchCol_2
(
ColId
,
len
)))
return
-
1
;
DBUG_RETURN
(
-
1
)
;
Uint32
len2
=
Interpreter
::
mod4
(
len
);
Uint32
len2
=
Interpreter
::
mod4
(
len
);
if
(
len2
==
len
){
if
(
len2
==
len
){
...
@@ -1065,7 +1071,7 @@ NdbOperation::branch_col(Uint32 type,
...
@@ -1065,7 +1071,7 @@ NdbOperation::branch_col(Uint32 type,
}
}
theErrorLine
++
;
theErrorLine
++
;
return
0
;
DBUG_RETURN
(
0
)
;
}
}
int
int
...
...
ndb/src/ndbapi/NdbScanFilter.cpp
View file @
b67f82d9
...
@@ -405,8 +405,8 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
...
@@ -405,8 +405,8 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
return
-
1
;
return
-
1
;
}
}
(
m_operation
->*
branch
)(
AttrId
,
value
,
len
,
false
,
m_current
.
m_ownLabel
);
int
ret
=
(
m_operation
->*
branch
)(
AttrId
,
value
,
len
,
false
,
m_current
.
m_ownLabel
);
return
0
;
return
ret
;
}
}
int
int
...
...
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