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
15ff383e
Commit
15ff383e
authored
Mar 14, 2003
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-4.1/
into serg.mysql.com:/usr/home/serg/Abk/mysql-4.1
parents
88df7b69
9749ece2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
43 deletions
+54
-43
mysql-test/r/binary.result
mysql-test/r/binary.result
+23
-22
mysql-test/t/binary.test
mysql-test/t/binary.test
+8
-8
sql/key.cc
sql/key.cc
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+5
-9
sql/sql_select.h
sql/sql_select.h
+1
-2
strings/ctype-bin.c
strings/ctype-bin.c
+16
-1
No files found.
mysql-test/r/binary.result
View file @
15ff383e
...
...
@@ -45,29 +45,30 @@ name
drop table t1,t2;
create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b));
insert into t1 values ("hello ","hello "),("hello2 ","hello2 ");
select * from t1 where a="hello";
a b
hello hello
select * from t1 where a="hello ";
a b
hello hello
select * from t1 ignore index (a) where a="hello ";
a b
hello hello
select * from t1 where b="hello";
a b
hello hello
select * from t1 where b="hello ";
a b
hello hello
select * from t1 ignore index (b) where b="hello ";
a b
select concat("-",a,"-",b,"-") from t1 where a="hello";
concat("-",a,"-",b,"-")
-hello-hello-
select concat("-",a,"-",b,"-") from t1 where a="hello ";
concat("-",a,"-",b,"-")
-hello-hello-
select concat("-",a,"-",b,"-") from t1 ignore index (a) where a="hello ";
concat("-",a,"-",b,"-")
-hello-hello-
select concat("-",a,"-",b,"-") from t1 where b="hello";
concat("-",a,"-",b,"-")
-hello-hello-
select concat("-",a,"-",b,"-") from t1 where b="hello ";
concat("-",a,"-",b,"-")
-hello-hello-
select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello ";
concat("-",a,"-",b,"-")
-hello-hello-
alter table t1 modify b tinytext not null, drop key b, add key (b(100));
select
*
from t1 where b="hello ";
a b
select
*
from t1 ignore index (b) where b="hello ";
a b
hello hello
select
concat("-",a,"-",b,"-")
from t1 where b="hello ";
concat("-",a,"-",b,"-")
select
concat("-",a,"-",b,"-")
from t1 ignore index (b) where b="hello ";
concat("-",a,"-",b,"-")
-hello-hello-
drop table t1;
create table t1 (b char(8));
insert into t1 values(NULL);
...
...
mysql-test/t/binary.test
View file @
15ff383e
...
...
@@ -30,16 +30,16 @@ drop table t1,t2;
create
table
t1
(
a
char
(
10
)
not
null
,
b
char
(
10
)
binary
not
null
,
key
(
a
),
key
(
b
));
insert
into
t1
values
(
"hello "
,
"hello "
),(
"hello2 "
,
"hello2 "
);
select
*
from
t1
where
a
=
"hello"
;
select
*
from
t1
where
a
=
"hello "
;
select
*
from
t1
ignore
index
(
a
)
where
a
=
"hello "
;
select
*
from
t1
where
b
=
"hello"
;
select
*
from
t1
where
b
=
"hello "
;
select
*
from
t1
ignore
index
(
b
)
where
b
=
"hello "
;
select
concat
(
"-"
,
a
,
"-"
,
b
,
"-"
)
from
t1
where
a
=
"hello"
;
select
concat
(
"-"
,
a
,
"-"
,
b
,
"-"
)
from
t1
where
a
=
"hello "
;
select
concat
(
"-"
,
a
,
"-"
,
b
,
"-"
)
from
t1
ignore
index
(
a
)
where
a
=
"hello "
;
select
concat
(
"-"
,
a
,
"-"
,
b
,
"-"
)
from
t1
where
b
=
"hello"
;
select
concat
(
"-"
,
a
,
"-"
,
b
,
"-"
)
from
t1
where
b
=
"hello "
;
select
concat
(
"-"
,
a
,
"-"
,
b
,
"-"
)
from
t1
ignore
index
(
b
)
where
b
=
"hello "
;
# blob test
alter
table
t1
modify
b
tinytext
not
null
,
drop
key
b
,
add
key
(
b
(
100
));
select
*
from
t1
where
b
=
"hello "
;
select
*
from
t1
ignore
index
(
b
)
where
b
=
"hello "
;
select
concat
(
"-"
,
a
,
"-"
,
b
,
"-"
)
from
t1
where
b
=
"hello "
;
select
concat
(
"-"
,
a
,
"-"
,
b
,
"-"
)
from
t1
ignore
index
(
b
)
where
b
=
"hello "
;
drop
table
t1
;
#
...
...
sql/key.cc
View file @
15ff383e
...
...
@@ -67,7 +67,7 @@ int find_ref_key(TABLE *table,Field *field, uint *key_length)
/* Copy a key from record to some buffer */
/* if length == 0 then copy hole key */
/* if length == 0 then copy
w
hole key */
void
key_copy
(
byte
*
key
,
TABLE
*
table
,
uint
idx
,
uint
key_length
)
{
...
...
sql/sql_select.cc
View file @
15ff383e
...
...
@@ -2753,19 +2753,15 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
if
(
!
keyuse
->
used_tables
&&
!
(
join
->
select_options
&
SELECT_DESCRIBE
))
{
// Compare against constant
store_key_item
*
tmp
=
new
store_key_item
(
thd
,
keyinfo
->
key_part
[
i
].
field
,
(
char
*
)
key_buff
+
maybe_null
,
maybe_null
?
(
char
*
)
key_buff
:
0
,
keyinfo
->
key_part
[
i
].
length
,
keyuse
->
val
);
store_key_item
tmp
(
thd
,
keyinfo
->
key_part
[
i
].
field
,
(
char
*
)
key_buff
+
maybe_null
,
maybe_null
?
(
char
*
)
key_buff
:
0
,
keyinfo
->
key_part
[
i
].
length
,
keyuse
->
val
);
if
(
thd
->
is_fatal_error
)
{
return
TRUE
;
}
tmp
->
copy
();
tmp
.
copy
();
}
else
*
ref_key
++=
get_store_key
(
thd
,
...
...
sql/sql_select.h
View file @
15ff383e
...
...
@@ -174,7 +174,7 @@ class JOIN :public Sql_alloc
Item_sum
**
sum_funcs
;
Procedure
*
procedure
;
Item
*
having
;
Item
*
tmp_having
;
// To store Having when processed te
n
porary table
Item
*
tmp_having
;
// To store Having when processed te
m
porary table
uint
select_options
;
select_result
*
result
;
TMP_TABLE_PARAM
tmp_table_param
;
...
...
@@ -306,7 +306,6 @@ class store_key :public Sql_alloc
{
protected:
Field
*
to_field
;
// Store data here
Field
*
key_field
;
// Copy of key field
char
*
null_ptr
;
char
err
;
public:
...
...
strings/ctype-bin.c
View file @
15ff383e
...
...
@@ -75,6 +75,21 @@ static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)),
return
cmp
?
cmp
:
(
int
)
(
slen
-
tlen
);
}
static
int
my_strnncollsp_binary
(
CHARSET_INFO
*
cs
,
const
uchar
*
s
,
uint
slen
,
const
uchar
*
t
,
uint
tlen
)
{
int
len
,
cmp
;
for
(
;
slen
&&
my_isspace
(
cs
,
s
[
slen
-
1
])
;
slen
--
);
for
(
;
tlen
&&
my_isspace
(
cs
,
t
[
tlen
-
1
])
;
tlen
--
);
len
=
(
slen
>
tlen
)
?
tlen
:
slen
;
cmp
=
memcmp
(
s
,
t
,
len
);
return
cmp
?
cmp
:
(
int
)
(
slen
-
tlen
);
}
static
void
my_caseup_str_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
char
*
str
__attribute__
((
unused
)))
{
...
...
@@ -309,7 +324,7 @@ CHARSET_INFO my_charset_bin =
""
,
""
,
0
,
/* strxfrm_multiply */
my_strnncoll_binary
,
/* strnncoll */
my_strnncoll_binary
,
my_strnncoll
sp
_binary
,
my_strnxfrm_bin
,
/* strxnfrm */
my_like_range_simple
,
/* like_range */
my_wildcmp_bin
,
/* wildcmp */
...
...
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