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
2f8be12b
Commit
2f8be12b
authored
Aug 23, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
parents
0df870ef
9ad24486
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
204 additions
and
37 deletions
+204
-37
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+2
-2
mysql-test/r/binary.result
mysql-test/r/binary.result
+18
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+10
-0
mysql-test/r/ndb_blob.result
mysql-test/r/ndb_blob.result
+50
-0
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+0
-7
mysql-test/t/binary.test
mysql-test/t/binary.test
+13
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+12
-0
mysql-test/t/ndb_blob.test
mysql-test/t/ndb_blob.test
+26
-0
mysql-test/t/show_check.test
mysql-test/t/show_check.test
+8
-6
ndb/include/ndbapi/NdbBlob.hpp
ndb/include/ndbapi/NdbBlob.hpp
+1
-2
ndb/include/ndbapi/NdbDictionary.hpp
ndb/include/ndbapi/NdbDictionary.hpp
+4
-0
ndb/src/ndbapi/NdbBlob.cpp
ndb/src/ndbapi/NdbBlob.cpp
+6
-7
ndb/src/ndbapi/NdbDictionary.cpp
ndb/src/ndbapi/NdbDictionary.cpp
+8
-0
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+23
-1
ndb/src/ndbapi/NdbDictionaryImpl.hpp
ndb/src/ndbapi/NdbDictionaryImpl.hpp
+4
-1
sql/key.cc
sql/key.cc
+11
-4
sql/mysqld.cc
sql/mysqld.cc
+0
-5
sql/sql_select.cc
sql/sql_select.cc
+8
-2
No files found.
mysql-test/mysql-test-run.sh
View file @
2f8be12b
...
...
@@ -1451,9 +1451,9 @@ then
then
echo
"Starting ndbcluster"
./ndb/ndbcluster
--port-base
=
$NDBCLUSTER_PORT
--small
--diskless
--initial
--data-dir
=
$MYSQL_TEST_DIR
/var
||
exit
1
USE_NDBCLUSTER
=
"--ndb-connectstring=
\"
host=localhost:
$NDBCLUSTER_PORT
\"
"
USE_NDBCLUSTER
=
"
$USE_NDBCLUSTER
--ndb-connectstring=
\"
host=localhost:
$NDBCLUSTER_PORT
\"
"
else
USE_NDBCLUSTER
=
"--ndb-connectstring=
\"
$USE_RUNNING_NDBCLUSTER
\"
"
USE_NDBCLUSTER
=
"
$USE_NDBCLUSTER
--ndb-connectstring=
\"
$USE_RUNNING_NDBCLUSTER
\"
"
echo
"Using ndbcluster at
$USE_NDBCLUSTER
"
fi
fi
...
...
mysql-test/r/binary.result
View file @
2f8be12b
...
...
@@ -116,3 +116,21 @@ select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
collation(a) collation(b) collation(binary 'ccc')
latin1_bin binary latin1_bin
drop table t1;
create table t1( firstname char(20), lastname char(20));
insert into t1 values ("john","doe"),("John","Doe");
select * from t1 where firstname='john' and firstname like binary 'john';
firstname lastname
john doe
select * from t1 where firstname='john' and binary 'john' = firstname;
firstname lastname
john doe
select * from t1 where firstname='john' and firstname = binary 'john';
firstname lastname
john doe
select * from t1 where firstname='John' and firstname like binary 'john';
firstname lastname
john doe
select * from t1 where firstname='john' and firstname like binary 'John';
firstname lastname
John Doe
drop table t1;
mysql-test/r/ctype_utf8.result
View file @
2f8be12b
...
...
@@ -560,3 +560,13 @@ select * from t1 where str='str';
str
str
drop table t1;
create table t1 (
str varchar(255) character set utf8 not null,
key str using hash (str(2))
) engine=heap;
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
str
str
drop table t1;
mysql-test/r/ndb_blob.result
View file @
2f8be12b
drop table if exists t1;
drop database if exists test2;
set autocommit=0;
create table t1 (
a int not null primary key,
...
...
@@ -220,6 +221,55 @@ a b c d
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
select * from t1 order by a;
a b c d
1 1xb1 111 1xdd1
2 2xb2 222 2xdd2
3 3xb3 333 3xdd3
4 4xb4 444 4xdd4
5 5xb5 555 5xdd5
6 6xb6 666 6xdd6
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
alter table t1 add x int;
select * from t1 order by a;
a b c d x
1 1xb1 111 1xdd1 NULL
2 2xb2 222 2xdd2 NULL
3 3xb3 333 3xdd3 NULL
4 4xb4 444 4xdd4 NULL
5 5xb5 555 5xdd5 NULL
6 6xb6 666 6xdd6 NULL
7 7xb7 777 7xdd7 NULL
8 8xb8 888 8xdd8 NULL
9 9xb9 999 9xdd9 NULL
alter table t1 drop x;
select * from t1 order by a;
a b c d
1 1xb1 111 1xdd1
2 2xb2 222 2xdd2
3 3xb3 333 3xdd3
4 4xb4 444 4xdd4
5 5xb5 555 5xdd5
6 6xb6 666 6xdd6
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
create database test2;
use test2;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
insert into t2 values (1,1,1),(2,2,2);
select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
a b c d a b c
1 1xb1 111 1xdd1 1 1 1
2 2xb2 222 2xdd2 2 2 2
drop table t2;
use test;
delete from t1 where c >= 100;
commit;
select count(*) from t1;
...
...
mysql-test/r/show_check.result
View file @
2f8be12b
...
...
@@ -401,10 +401,3 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
delete from mysql.db
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush privileges;
set names latin1;
create database ``;
create table ``.`` (a int) engine=heap;
show table status from `` LIKE '';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
drop database ``;
mysql-test/t/binary.test
View file @
2f8be12b
...
...
@@ -67,3 +67,16 @@ select * from t1 where lower(b)='bbb';
select
charset
(
a
),
charset
(
b
),
charset
(
binary
'ccc'
)
from
t1
limit
1
;
select
collation
(
a
),
collation
(
b
),
collation
(
binary
'ccc'
)
from
t1
limit
1
;
drop
table
t1
;
#
# Bug5134: WHERE x = 'bar' AND x LIKE BINARY 'bar' returns wrong results
#
create
table
t1
(
firstname
char
(
20
),
lastname
char
(
20
));
insert
into
t1
values
(
"john"
,
"doe"
),(
"John"
,
"Doe"
);
select
*
from
t1
where
firstname
=
'john'
and
firstname
like
binary
'john'
;
select
*
from
t1
where
firstname
=
'john'
and
binary
'john'
=
firstname
;
select
*
from
t1
where
firstname
=
'john'
and
firstname
=
binary
'john'
;
select
*
from
t1
where
firstname
=
'John'
and
firstname
like
binary
'john'
;
select
*
from
t1
where
firstname
=
'john'
and
firstname
like
binary
'John'
;
drop
table
t1
;
mysql-test/t/ctype_utf8.test
View file @
2f8be12b
...
...
@@ -417,3 +417,15 @@ INSERT INTO t1 VALUES ('str');
INSERT
INTO
t1
VALUES
(
'str2'
);
select
*
from
t1
where
str
=
'str'
;
drop
table
t1
;
# the same for HEAP+HASH
#
create
table
t1
(
str
varchar
(
255
)
character
set
utf8
not
null
,
key
str
using
hash
(
str
(
2
))
)
engine
=
heap
;
INSERT
INTO
t1
VALUES
(
'str'
);
INSERT
INTO
t1
VALUES
(
'str2'
);
select
*
from
t1
where
str
=
'str'
;
drop
table
t1
;
mysql-test/t/ndb_blob.test
View file @
2f8be12b
...
...
@@ -2,6 +2,7 @@
--
disable_warnings
drop
table
if
exists
t1
;
drop
database
if
exists
test2
;
--
enable_warnings
#
...
...
@@ -203,6 +204,31 @@ where c >= 100;
commit
;
select
*
from
t1
where
c
>=
100
order
by
a
;
# alter table
select
*
from
t1
order
by
a
;
alter
table
t1
add
x
int
;
select
*
from
t1
order
by
a
;
alter
table
t1
drop
x
;
select
*
from
t1
order
by
a
;
# multi db
create
database
test2
;
use
test2
;
CREATE
TABLE
t2
(
a
bigint
unsigned
NOT
NULL
PRIMARY
KEY
,
b
int
unsigned
not
null
,
c
int
unsigned
)
engine
=
ndbcluster
;
insert
into
t2
values
(
1
,
1
,
1
),(
2
,
2
,
2
);
select
*
from
test
.
t1
,
t2
where
test
.
t1
.
a
=
t2
.
a
order
by
test
.
t1
.
a
;
drop
table
t2
;
use
test
;
# range scan delete
delete
from
t1
where
c
>=
100
;
commit
;
...
...
mysql-test/t/show_check.test
View file @
2f8be12b
...
...
@@ -307,9 +307,11 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush
privileges
;
#Bug #4374 SHOW TABLE STATUS FROM ignores collation_connection
set
names
latin1
;
create
database
``
;
create
table
``
.
``
(
a
int
)
engine
=
heap
;
--
replace_column
7
# 8 # 9 #
show
table
status
from
``
LIKE
''
;
drop
database
``
;
# This test fails on MAC OSX, so it is temporary disabled.
# This needs WL#1324 to be done.
#set names latin1;
#create database ``;
#create table ``.`` (a int) engine=heap;
#--replace_column 7 # 8 # 9 #
#show table status from `` LIKE '';
#drop database ``;
ndb/include/ndbapi/NdbBlob.hpp
View file @
2f8be12b
...
...
@@ -234,14 +234,13 @@ private:
// define blob table
static
void
getBlobTableName
(
char
*
btname
,
const
NdbTableImpl
*
t
,
const
NdbColumnImpl
*
c
);
static
void
getBlobTable
(
NdbTableImpl
&
bt
,
const
NdbTableImpl
*
t
,
const
NdbColumnImpl
*
c
);
// table name
char
theBlobTableName
[
BlobTableNameSize
];
// ndb api stuff
Ndb
*
theNdb
;
NdbConnection
*
theNdbCon
;
NdbOperation
*
theNdbOp
;
NdbTableImpl
*
theTable
;
NdbTableImpl
*
theAccessTable
;
NdbTableImpl
*
theBlobTable
;
const
NdbColumnImpl
*
theColumn
;
char
theFillChar
;
// sizes
...
...
ndb/include/ndbapi/NdbDictionary.hpp
View file @
2f8be12b
...
...
@@ -144,6 +144,8 @@ public:
FragAllLarge
=
4
///< Eight fragments per node group.
};
};
class
Table
;
// forward declaration
/**
* @class Column
...
...
@@ -365,6 +367,8 @@ public:
void
setIndexOnlyStorage
(
bool
);
bool
getIndexOnlyStorage
()
const
;
const
Table
*
getBlobTable
()
const
;
/**
* @name ODBC Specific methods
* @{
...
...
ndb/src/ndbapi/NdbBlob.cpp
View file @
2f8be12b
...
...
@@ -140,7 +140,6 @@ void
NdbBlob
::
init
()
{
theState
=
Idle
;
theBlobTableName
[
0
]
=
0
;
theNdb
=
NULL
;
theNdbCon
=
NULL
;
theNdbOp
=
NULL
;
...
...
@@ -865,7 +864,7 @@ NdbBlob::readParts(char* buf, Uint32 part, Uint32 count)
DBG
(
"readParts part="
<<
part
<<
" count="
<<
count
);
Uint32
n
=
0
;
while
(
n
<
count
)
{
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theBlobTable
Name
);
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theBlobTable
);
if
(
tOp
==
NULL
||
tOp
->
readTuple
()
==
-
1
||
setPartKeyValue
(
tOp
,
part
+
n
)
==
-
1
||
...
...
@@ -887,7 +886,7 @@ NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count)
DBG
(
"insertParts part="
<<
part
<<
" count="
<<
count
);
Uint32
n
=
0
;
while
(
n
<
count
)
{
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theBlobTable
Name
);
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theBlobTable
);
if
(
tOp
==
NULL
||
tOp
->
insertTuple
()
==
-
1
||
setPartKeyValue
(
tOp
,
part
+
n
)
==
-
1
||
...
...
@@ -909,7 +908,7 @@ NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count)
DBG
(
"updateParts part="
<<
part
<<
" count="
<<
count
);
Uint32
n
=
0
;
while
(
n
<
count
)
{
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theBlobTable
Name
);
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theBlobTable
);
if
(
tOp
==
NULL
||
tOp
->
updateTuple
()
==
-
1
||
setPartKeyValue
(
tOp
,
part
+
n
)
==
-
1
||
...
...
@@ -931,7 +930,7 @@ NdbBlob::deleteParts(Uint32 part, Uint32 count)
DBG
(
"deleteParts part="
<<
part
<<
" count="
<<
count
);
Uint32
n
=
0
;
while
(
n
<
count
)
{
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theBlobTable
Name
);
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theBlobTable
);
if
(
tOp
==
NULL
||
tOp
->
deleteTuple
()
==
-
1
||
setPartKeyValue
(
tOp
,
part
+
n
)
==
-
1
)
{
...
...
@@ -1029,12 +1028,11 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl*
// sanity check
assert
((
NDB_BLOB_HEAD_SIZE
<<
2
)
==
sizeof
(
Head
));
assert
(
theColumn
->
m_attrSize
*
theColumn
->
m_arraySize
==
sizeof
(
Head
)
+
theInlineSize
);
getBlobTableName
(
theBlobTableName
,
theTable
,
theColumn
);
const
NdbDictionary
::
Table
*
bt
;
const
NdbDictionary
::
Column
*
bc
;
if
(
thePartSize
>
0
)
{
if
(
theStripeSize
==
0
||
(
bt
=
the
Ndb
->
theDictionary
->
getTable
(
theBlobTableName
))
==
NULL
||
(
bt
=
the
Column
->
getBlobTable
(
))
==
NULL
||
(
bc
=
bt
->
getColumn
(
"DATA"
))
==
NULL
||
bc
->
getType
()
!=
partType
||
bc
->
getLength
()
!=
(
int
)
thePartSize
)
{
...
...
@@ -1042,6 +1040,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl*
return
-
1
;
}
}
theBlobTable
=
&
NdbTableImpl
::
getImpl
(
*
bt
);
// buffers
theKeyBuf
.
alloc
(
theTable
->
m_sizeOfKeysInWords
<<
2
);
theAccessKeyBuf
.
alloc
(
theAccessTable
->
m_sizeOfKeysInWords
<<
2
);
...
...
ndb/src/ndbapi/NdbDictionary.cpp
View file @
2f8be12b
...
...
@@ -174,6 +174,14 @@ NdbDictionary::Column::getIndexOnlyStorage() const {
return
m_impl
.
m_indexOnly
;
}
const
NdbDictionary
::
Table
*
NdbDictionary
::
Column
::
getBlobTable
()
const
{
NdbTableImpl
*
t
=
m_impl
.
m_blobTable
;
if
(
t
)
return
t
->
m_facade
;
return
0
;
}
void
NdbDictionary
::
Column
::
setAutoIncrement
(
bool
val
){
m_impl
.
m_autoIncrement
=
val
;
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
2f8be12b
...
...
@@ -79,6 +79,7 @@ NdbColumnImpl::operator=(const NdbColumnImpl& col)
m_attrSize
=
col
.
m_attrSize
;
m_arraySize
=
col
.
m_arraySize
;
m_keyInfoPos
=
col
.
m_keyInfoPos
;
m_blobTable
=
col
.
m_blobTable
;
// Do not copy m_facade !!
return
*
this
;
...
...
@@ -104,6 +105,7 @@ NdbColumnImpl::init()
m_arraySize
=
1
,
m_autoIncrement
=
false
;
m_autoIncrementInitialValue
=
1
;
m_blobTable
=
NULL
;
}
NdbColumnImpl
::~
NdbColumnImpl
()
...
...
@@ -1211,7 +1213,6 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
}
if
(
col
->
getBlobType
())
blobCount
++
;
NdbColumnImpl
*
null
=
0
;
impl
->
m_columns
.
fill
(
attrDesc
.
AttributeId
,
null
);
if
(
impl
->
m_columns
[
attrDesc
.
AttributeId
]
!=
0
){
...
...
@@ -1266,7 +1267,28 @@ NdbDictionaryImpl::createBlobTables(NdbTableImpl &t)
NdbBlob
::
getBlobTable
(
bt
,
&
t
,
&
c
);
if
(
createTable
(
bt
)
!=
0
)
return
-
1
;
// Save BLOB table handle
NdbTableImpl
*
cachedBlobTable
=
getTable
(
bt
.
m_externalName
.
c_str
());
c
.
m_blobTable
=
cachedBlobTable
;
}
return
0
;
}
int
NdbDictionaryImpl
::
addBlobTables
(
NdbTableImpl
&
t
)
{
for
(
unsigned
i
=
0
;
i
<
t
.
m_columns
.
size
();
i
++
)
{
NdbColumnImpl
&
c
=
*
t
.
m_columns
[
i
];
if
(
!
c
.
getBlobType
()
||
c
.
getPartSize
()
==
0
)
continue
;
char
btname
[
NdbBlob
::
BlobTableNameSize
];
NdbBlob
::
getBlobTableName
(
btname
,
&
t
,
&
c
);
// Save BLOB table handle
NdbTableImpl
*
cachedBlobTable
=
getTable
(
btname
);;
c
.
m_blobTable
=
cachedBlobTable
;
}
return
0
;
}
...
...
ndb/src/ndbapi/NdbDictionaryImpl.hpp
View file @
2f8be12b
...
...
@@ -71,6 +71,7 @@ public:
bool
m_autoIncrement
;
Uint64
m_autoIncrementInitialValue
;
BaseString
m_defaultValue
;
NdbTableImpl
*
m_blobTable
;
/**
* Internal types and sizes, and aggregates
...
...
@@ -362,6 +363,7 @@ public:
int
createTable
(
NdbTableImpl
&
t
);
int
createBlobTables
(
NdbTableImpl
&
);
int
addBlobTables
(
NdbTableImpl
&
);
int
alterTable
(
NdbTableImpl
&
t
);
int
dropTable
(
const
char
*
name
);
int
dropTable
(
NdbTableImpl
&
);
...
...
@@ -616,7 +618,6 @@ NdbDictionaryImpl::getTableImpl(const char * internalTableName)
if
(
ret
==
0
){
ret
=
m_receiver
.
getTable
(
internalTableName
,
m_ndb
.
usingFullyQualifiedNames
());
m_globalHash
->
lock
();
m_globalHash
->
put
(
internalTableName
,
ret
);
m_globalHash
->
unlock
();
...
...
@@ -629,6 +630,8 @@ NdbDictionaryImpl::getTableImpl(const char * internalTableName)
m_ndb
.
theFirstTupleId
[
ret
->
getTableId
()]
=
~
0
;
m_ndb
.
theLastTupleId
[
ret
->
getTableId
()]
=
~
0
;
addBlobTables
(
*
ret
);
return
ret
;
}
...
...
sql/key.cc
View file @
2f8be12b
...
...
@@ -211,10 +211,17 @@ bool key_cmp_if_same(TABLE *table,const byte *key,uint idx,uint key_length)
if
(
!
(
key_part
->
key_type
&
(
FIELDFLAG_NUMBER
+
FIELDFLAG_BINARY
+
FIELDFLAG_PACK
)))
{
if
(
my_strnncoll
(
key_part
->
field
->
charset
(),
(
const
uchar
*
)
key
,
length
,
(
const
uchar
*
)
table
->
record
[
0
]
+
key_part
->
offset
,
length
))
CHARSET_INFO
*
cs
=
key_part
->
field
->
charset
();
uint
char_length
=
key_part
->
length
/
cs
->
mbmaxlen
;
const
byte
*
pos
=
table
->
record
[
0
]
+
key_part
->
offset
;
if
(
length
>
char_length
)
{
char_length
=
my_charpos
(
cs
,
pos
,
pos
+
length
,
char_length
);
set_if_smaller
(
char_length
,
length
);
}
if
(
cs
->
coll
->
strnncollsp
(
cs
,
(
const
uchar
*
)
key
,
length
,
(
const
uchar
*
)
pos
,
char_length
))
return
1
;
}
else
if
(
memcmp
(
key
,
table
->
record
[
0
]
+
key_part
->
offset
,
length
))
...
...
sql/mysqld.cc
View file @
2f8be12b
...
...
@@ -6004,11 +6004,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
have_ndbcluster
=
SHOW_OPTION_DISABLED
;
#endif
break
;
#ifdef HAVE_NDBCLUSTER_DB
case
OPT_NDB_CONNECTSTRING
:
have_ndbcluster
=
SHOW_OPTION_YES
;
break
;
#endif
case
OPT_INNODB
:
#ifdef HAVE_INNOBASE_DB
if
(
opt_innodb
)
...
...
sql/sql_select.cc
View file @
2f8be12b
...
...
@@ -4186,7 +4186,10 @@ change_cond_ref_to_const(I_List<COND_CMP> *save_list,Item *and_father,
Item
*
right_item
=
func
->
arguments
()[
1
];
Item_func
::
Functype
functype
=
func
->
functype
();
if
(
right_item
->
eq
(
field
,
0
)
&&
left_item
!=
value
)
if
(
right_item
->
eq
(
field
,
0
)
&&
left_item
!=
value
&&
(
left_item
->
result_type
()
!=
STRING_RESULT
||
value
->
result_type
()
!=
STRING_RESULT
||
left_item
->
collation
.
collation
==
value
->
collation
.
collation
))
{
Item
*
tmp
=
value
->
new_item
();
if
(
tmp
)
...
...
@@ -4204,7 +4207,10 @@ change_cond_ref_to_const(I_List<COND_CMP> *save_list,Item *and_father,
func
->
set_cmp_func
();
}
}
else
if
(
left_item
->
eq
(
field
,
0
)
&&
right_item
!=
value
)
else
if
(
left_item
->
eq
(
field
,
0
)
&&
right_item
!=
value
&&
(
right_item
->
result_type
()
!=
STRING_RESULT
||
value
->
result_type
()
!=
STRING_RESULT
||
right_item
->
collation
.
collation
==
value
->
collation
.
collation
))
{
Item
*
tmp
=
value
->
new_item
();
if
(
tmp
)
...
...
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