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
9a8ed3fe
Commit
9a8ed3fe
authored
Aug 31, 2006
by
tsmith@maint2.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge maint2.mysql.com:/data/localhome/tsmith/bk/g41
into maint2.mysql.com:/data/localhome/tsmith/bk/41
parents
4ae5e616
af9895d4
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
145 additions
and
14 deletions
+145
-14
include/mysql_com.h
include/mysql_com.h
+3
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+12
-0
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+21
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+22
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+16
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+27
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+24
-0
sql-common/client.c
sql-common/client.c
+3
-3
sql/item_subselect.cc
sql/item_subselect.cc
+5
-5
sql/opt_range.h
sql/opt_range.h
+1
-1
sql/sql_acl.cc
sql/sql_acl.cc
+5
-1
sql/sql_parse.cc
sql/sql_parse.cc
+2
-2
sql/table.cc
sql/table.cc
+4
-2
No files found.
include/mysql_com.h
View file @
9a8ed3fe
...
...
@@ -26,6 +26,9 @@
#define USERNAME_LENGTH 16
#define SERVER_VERSION_LENGTH 60
#define SQLSTATE_LENGTH 5
#define SYSTEM_CHARSET_MBMAXLEN 3
#define NAME_BYTE_LEN NAME_LEN*SYSTEM_CHARSET_MBMAXLEN
#define USERNAME_BYTE_LENGTH USERNAME_LENGTH*SYSTEM_CHARSET_MBMAXLEN
#define LOCAL_HOST "localhost"
#define LOCAL_HOST_NAMEDPIPE "."
...
...
mysql-test/r/ctype_utf8.result
View file @
9a8ed3fe
...
...
@@ -1340,3 +1340,15 @@ select a from t1 group by a;
a
e
drop table t1;
set names utf8;
grant select on test.* to юзер_юзер@localhost;
user()
юзер_юзер@localhost
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
select database();
database()
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
mysql-test/r/innodb_mysql.result
View file @
9a8ed3fe
...
...
@@ -83,3 +83,24 @@ b a
3 3
3 3
DROP TABLE t1, t2, t3;
CREATE TABLE `t1` (`id1` INT) ;
INSERT INTO `t1` (`id1`) VALUES (1),(5),(2);
CREATE TABLE `t2` (
`id1` INT,
`id2` INT NOT NULL,
`id3` INT,
`id4` INT NOT NULL,
UNIQUE (`id2`,`id4`),
KEY (`id1`)
) ENGINE=InnoDB;
INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
(1,1,1,0),
(1,1,2,1),
(5,1,2,2),
(6,1,2,3),
(1,2,2,2),
(1,2,1,1);
SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND `id3` = 2);
id1
2
DROP TABLE t1, t2;
mysql-test/r/subselect.result
View file @
9a8ed3fe
...
...
@@ -2895,3 +2895,25 @@ select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
s1
2
drop table t1;
create table t1 (
retailerID varchar(8) NOT NULL,
statusID int(10) unsigned NOT NULL,
changed datetime NOT NULL,
UNIQUE KEY retailerID (retailerID, statusID, changed)
);
INSERT INTO t1 VALUES("0026", "1", "2005-12-06 12:18:56");
INSERT INTO t1 VALUES("0026", "2", "2006-01-06 12:25:53");
INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56");
INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53");
INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50");
INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50");
select * from t1 r1
where (r1.retailerID,(r1.changed)) in
(SELECT r2.retailerId,(max(changed)) from t1 r2
group by r2.retailerId);
retailerID statusID changed
0026 2 2006-01-06 12:25:53
0037 2 2006-01-06 12:25:53
0048 1 2006-01-06 12:37:50
0059 1 2006-01-06 12:37:50
drop table t1;
mysql-test/t/ctype_utf8.test
View file @
9a8ed3fe
...
...
@@ -1072,4 +1072,20 @@ explain select a from t1 group by a;
select
a
from
t1
group
by
a
;
drop
table
t1
;
#
# Bug#20393: User name truncation in mysql client
# Bug#21432: Database/Table name limited to 64 bytes, not chars, problems with multi-byte
#
set
names
utf8
;
#create user юзер_юзер@localhost;
grant
select
on
test
.*
to
юзер_юзер
@
localhost
;
--
exec
$MYSQL
--
default
-
character
-
set
=
utf8
--
user
=
юзер_юзер
-
e
"select user()"
revoke
all
on
test
.*
from
юзер_юзер
@
localhost
;
drop
user
юзер_юзер
@
localhost
;
create
database
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
;
use
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
;
select
database
();
drop
database
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
;
# End of 4.1 tests
mysql-test/t/innodb_mysql.test
View file @
9a8ed3fe
...
...
@@ -90,3 +90,30 @@ SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3
.
a
=
t2
.
a
AND
t2
.
b
=
t1
.
a
AND
t3
.
b
=
1
AND
t3
.
c
IN
(
1
,
2
)
ORDER
BY
t1
.
b
LIMIT
5
;
DROP
TABLE
t1
,
t2
,
t3
;
# BUG#21077 (The testcase is not deterministic so correct execution doesn't
# prove anything) For proof one should track if sequence of ha_innodb::* func
# calls is correct.
CREATE
TABLE
`t1`
(
`id1`
INT
)
;
INSERT
INTO
`t1`
(
`id1`
)
VALUES
(
1
),(
5
),(
2
);
CREATE
TABLE
`t2`
(
`id1`
INT
,
`id2`
INT
NOT
NULL
,
`id3`
INT
,
`id4`
INT
NOT
NULL
,
UNIQUE
(
`id2`
,
`id4`
),
KEY
(
`id1`
)
)
ENGINE
=
InnoDB
;
INSERT
INTO
`t2`
(
`id1`
,
`id2`
,
`id3`
,
`id4`
)
VALUES
(
1
,
1
,
1
,
0
),
(
1
,
1
,
2
,
1
),
(
5
,
1
,
2
,
2
),
(
6
,
1
,
2
,
3
),
(
1
,
2
,
2
,
2
),
(
1
,
2
,
1
,
1
);
SELECT
`id1`
FROM
`t1`
WHERE
`id1`
NOT
IN
(
SELECT
`id1`
FROM
`t2`
WHERE
`id2`
=
1
AND
`id3`
=
2
);
DROP
TABLE
t1
,
t2
;
mysql-test/t/subselect.test
View file @
9a8ed3fe
...
...
@@ -1861,4 +1861,28 @@ select * from t1 where NOT(s1+1 = ANY (select s1 from t1));
select
*
from
t1
where
(
s1
=
ALL
(
select
s1
/
s1
from
t1
));
select
*
from
t1
where
NOT
(
s1
=
ALL
(
select
s1
/
s1
from
t1
));
drop
table
t1
;
#
# Bug #16255: Subquery in where
#
create
table
t1
(
retailerID
varchar
(
8
)
NOT
NULL
,
statusID
int
(
10
)
unsigned
NOT
NULL
,
changed
datetime
NOT
NULL
,
UNIQUE
KEY
retailerID
(
retailerID
,
statusID
,
changed
)
);
INSERT
INTO
t1
VALUES
(
"0026"
,
"1"
,
"2005-12-06 12:18:56"
);
INSERT
INTO
t1
VALUES
(
"0026"
,
"2"
,
"2006-01-06 12:25:53"
);
INSERT
INTO
t1
VALUES
(
"0037"
,
"1"
,
"2005-12-06 12:18:56"
);
INSERT
INTO
t1
VALUES
(
"0037"
,
"2"
,
"2006-01-06 12:25:53"
);
INSERT
INTO
t1
VALUES
(
"0048"
,
"1"
,
"2006-01-06 12:37:50"
);
INSERT
INTO
t1
VALUES
(
"0059"
,
"1"
,
"2006-01-06 12:37:50"
);
select
*
from
t1
r1
where
(
r1
.
retailerID
,(
r1
.
changed
))
in
(
SELECT
r2
.
retailerId
,(
max
(
changed
))
from
t1
r2
group
by
r2
.
retailerId
);
drop
table
t1
;
# End of 4.1 tests
sql-common/client.c
View file @
9a8ed3fe
...
...
@@ -1618,7 +1618,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
const
char
*
passwd
,
const
char
*
db
,
uint
port
,
const
char
*
unix_socket
,
ulong
client_flag
)
{
char
buff
[
NAME_
LEN
+
USERNAM
E_LENGTH
+
100
];
char
buff
[
NAME_
BYTE_LEN
+
USERNAME_BYT
E_LENGTH
+
100
];
char
*
end
,
*
host_info
;
my_socket
sock
;
in_addr_t
ip_addr
;
...
...
@@ -2063,7 +2063,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
mysql
->
server_status
,
client_flag
));
/* This needs to be changed as it's not useful with big packets */
if
(
user
&&
user
[
0
])
strmake
(
end
,
user
,
USERNAME_LENGTH
);
/* Max user name */
strmake
(
end
,
user
,
USERNAME_
BYTE_
LENGTH
);
/* Max user name */
else
read_user_name
((
char
*
)
end
);
...
...
@@ -2093,7 +2093,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* Add database if needed */
if
(
db
&&
(
mysql
->
server_capabilities
&
CLIENT_CONNECT_WITH_DB
))
{
end
=
strmake
(
end
,
db
,
NAME_LEN
)
+
1
;
end
=
strmake
(
end
,
db
,
NAME_
BYTE_
LEN
)
+
1
;
mysql
->
db
=
my_strdup
(
db
,
MYF
(
MY_WME
));
db
=
0
;
}
...
...
sql/item_subselect.cc
View file @
9a8ed3fe
...
...
@@ -976,18 +976,18 @@ Item_in_subselect::row_value_transformer(JOIN *join)
DBUG_RETURN
(
RES_ERROR
);
Item
*
item_eq
=
new
Item_func_eq
(
new
Item_
direct_
ref
((
*
optimizer
->
get_cache
())
->
Item_ref
((
*
optimizer
->
get_cache
())
->
addr
(
i
),
(
char
*
)
"<no matter>"
,
(
char
*
)
in_left_expr_name
),
new
Item_
direct_
ref
(
select_lex
->
ref_pointer_array
+
i
,
Item_ref
(
select_lex
->
ref_pointer_array
+
i
,
(
char
*
)
"<no matter>"
,
(
char
*
)
"<list ref>"
)
);
Item
*
item_isnull
=
new
Item_func_isnull
(
new
Item_
direct_
ref
(
select_lex
->
Item_ref
(
select_lex
->
ref_pointer_array
+
i
,
(
char
*
)
"<no matter>"
,
(
char
*
)
"<list ref>"
)
...
...
@@ -1000,7 +1000,7 @@ Item_in_subselect::row_value_transformer(JOIN *join)
new
Item_is_not_null_test
(
this
,
new
Item_
direct_
ref
(
select_lex
->
Item_ref
(
select_lex
->
ref_pointer_array
+
i
,
(
char
*
)
"<no matter>"
,
(
char
*
)
"<list ref>"
)
...
...
@@ -1057,7 +1057,7 @@ Item_in_subselect::row_value_transformer(JOIN *join)
new
Item_is_not_null_test
(
this
,
new
Item_
direct_
ref
(
select_lex
->
Item_ref
(
select_lex
->
ref_pointer_array
+
i
,
(
char
*
)
"<no matter>"
,
(
char
*
)
"<list ref>"
)
...
...
sql/opt_range.h
View file @
9a8ed3fe
...
...
@@ -86,7 +86,7 @@ public:
QUICK_SELECT
(
THD
*
thd
,
TABLE
*
table
,
uint
index_arg
,
bool
no_alloc
=
0
);
virtual
~
QUICK_SELECT
();
void
reset
(
void
)
{
next
=
0
;
it
.
rewind
();
}
void
reset
(
void
)
{
next
=
0
;
it
.
rewind
();
range
=
NULL
;
}
int
init
()
{
key_part_info
=
head
->
key_info
[
index
].
key_part
;
...
...
sql/sql_acl.cc
View file @
9a8ed3fe
...
...
@@ -2640,7 +2640,11 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
while
((
Str
=
str_list
++
))
{
if
(
Str
->
host
.
length
>
HOSTNAME_LENGTH
||
Str
->
user
.
length
>
USERNAME_LENGTH
)
system_charset_info
->
cset
->
charpos
(
system_charset_info
,
Str
->
user
.
str
,
Str
->
user
.
str
+
Str
->
user
.
length
,
USERNAME_LENGTH
)
<
Str
->
user
.
length
)
{
my_error
(
ER_GRANT_WRONG_HOST_OR_USER
,
MYF
(
0
));
result
=
-
1
;
...
...
sql/sql_parse.cc
View file @
9a8ed3fe
...
...
@@ -902,8 +902,8 @@ static int check_connection(THD *thd)
char
*
user
=
end
;
char
*
passwd
=
strend
(
user
)
+
1
;
char
*
db
=
passwd
;
char
db_buff
[
NAME_
LEN
+
1
];
// buffer to store db in utf8
char
user_buff
[
USERNAME_
LENGTH
+
1
];
// buffer to store user in utf8
char
db_buff
[
NAME_
BYTE_LEN
+
1
];
// buffer to store db in utf8
char
user_buff
[
USERNAME_
BYTE_LENGTH
+
1
];
// buffer to store user in utf8
uint
dummy_errors
;
/*
...
...
sql/table.cc
View file @
9a8ed3fe
...
...
@@ -1413,7 +1413,7 @@ char *get_field(MEM_ROOT *mem, Field *field)
bool
check_db_name
(
char
*
name
)
{
char
*
start
=
name
;
uint
name_length
=
0
;
// name length in symbols
/* Used to catch empty names and names with end space */
bool
last_char_is_space
=
TRUE
;
...
...
@@ -1430,6 +1430,7 @@ bool check_db_name(char *name)
name
+
system_charset_info
->
mbmaxlen
);
if
(
len
)
{
name_length
++
;
name
+=
len
;
continue
;
}
...
...
@@ -1437,12 +1438,13 @@ bool check_db_name(char *name)
#else
last_char_is_space
=
*
name
==
' '
;
#endif
name_length
++
;
if
(
*
name
==
'/'
||
*
name
==
'\\'
||
*
name
==
FN_LIBCHAR
||
*
name
==
FN_EXTCHAR
)
return
1
;
name
++
;
}
return
last_char_is_space
||
(
uint
)
(
name
-
start
)
>
NAME_LEN
;
return
(
last_char_is_space
||
name_length
>
NAME_LEN
)
;
}
...
...
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