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
62a26cf8
Commit
62a26cf8
authored
Oct 03, 2002
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update after last merge. Fixes some wrong test results.
parent
0f394576
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
66 additions
and
55 deletions
+66
-55
libmysql/libmysql.c
libmysql/libmysql.c
+0
-13
mysql-test/r/rpl_log.result
mysql-test/r/rpl_log.result
+8
-8
mysql-test/r/rpl_log_pos.result
mysql-test/r/rpl_log_pos.result
+1
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+3
-2
sql/log_event.cc
sql/log_event.cc
+7
-4
sql/net_pkg.cc
sql/net_pkg.cc
+2
-0
sql/sql_acl.cc
sql/sql_acl.cc
+9
-9
sql/sql_lex.cc
sql/sql_lex.cc
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+4
-3
sql/time.cc
sql/time.cc
+30
-13
No files found.
libmysql/libmysql.c
View file @
62a26cf8
...
...
@@ -3389,19 +3389,6 @@ static my_bool read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
metadata information by reading from server
*/
/* QQ The follwing function will be removed after next merge */
static
char
*
my_strdup_with_length
(
const
byte
*
from
,
uint
length
,
myf
MyFlags
)
{
gptr
ptr
;
if
((
ptr
=
my_malloc
(
length
+
1
,
MyFlags
))
!=
0
)
{
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
((
char
*
)
ptr
)[
length
]
=
0
;
}
return
((
char
*
)
ptr
);
}
MYSQL_STMT
*
STDCALL
mysql_prepare
(
MYSQL
*
mysql
,
const
char
*
query
,
ulong
length
)
...
...
mysql-test/r/rpl_log.result
View file @
62a26cf8
...
...
@@ -71,20 +71,20 @@ slave-bin.002
show binlog events in 'slave-bin.001' from 4;
Log_name Pos Event_type Server_id Orig_log_pos Info
slave-bin.001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3
slave-bin.001 79 Query 1 79 use
test
; create table t1(n int not null auto_increment primary key)
slave-bin.001 79 Query 1 79 use
`test`
; create table t1(n int not null auto_increment primary key)
slave-bin.001 172 Intvar 1 200 INSERT_ID=1
slave-bin.001 200 Query 1 200 use
test
; insert into t1 values (NULL)
slave-bin.001 263 Query 1 263 use
test
; drop table t1
slave-bin.001 311 Query 1 311 use
test
; create table t1 (word char(20) not null)
slave-bin.001 200 Query 1 200 use
`test`
; insert into t1 values (NULL)
slave-bin.001 263 Query 1 263 use
`test`
; drop table t1
slave-bin.001 311 Query 1 311 use
`test`
; create table t1 (word char(20) not null)
slave-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=81
slave-bin.001 565 Exec_load 1 556 ;file_id=1
slave-bin.001 588 Query 1 579 use
test
; drop table t1
slave-bin.001 588 Query 1 579 use
`test`
; drop table t1
slave-bin.001 636 Rotate 2 636 slave-bin.002;pos=4
show binlog events in 'slave-bin.002' from 4;
Log_name Pos Event_type Server_id Orig_log_pos Info
slave-bin.002
57
Query 1 4 use `test`; create table t1 (n int)
slave-bin.002
115
Query 1 62 use `test`; insert into t1 values (1)
slave-bin.002 1
75
Query 1 122 use `test`; drop table t1
slave-bin.002
4
Query 1 4 use `test`; create table t1 (n int)
slave-bin.002
62
Query 1 62 use `test`; insert into t1 values (1)
slave-bin.002 1
22
Query 1 122 use `test`; drop table t1
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 957 master-bin.002 Yes Yes 0 0 170 961
...
...
mysql-test/r/rpl_log_pos.result
View file @
62a26cf8
...
...
@@ -9,7 +9,7 @@ File Position Binlog_do_db Binlog_ignore_db
master-bin.001 79
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 12
4
127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 12
8
change master to master_log_pos=73;
slave stop;
change master to master_log_pos=73;
...
...
sql/item_strfunc.cc
View file @
62a26cf8
...
...
@@ -145,7 +145,7 @@ void Item_func_sha::fix_length_and_dec()
String
*
Item_func_aes_encrypt
::
val_str
(
String
*
str
)
{
char
key_buff
[
80
];
String
tmp_key_value
(
key_buff
,
sizeof
(
key_buff
));
String
tmp_key_value
(
key_buff
,
sizeof
(
key_buff
)
,
system_charset_info
);
String
*
sptr
=
args
[
0
]
->
val_str
(
str
);
// String to encrypt
String
*
key
=
args
[
1
]
->
val_str
(
&
tmp_key_value
);
// key
int
aes_length
;
...
...
@@ -180,7 +180,8 @@ void Item_func_aes_encrypt::fix_length_and_dec()
String
*
Item_func_aes_decrypt
::
val_str
(
String
*
str
)
{
char
key_buff
[
80
];
String
tmp_key_value
(
key_buff
,
sizeof
(
key_buff
)),
*
sptr
,
*
key
;
String
tmp_key_value
(
key_buff
,
sizeof
(
key_buff
),
system_charset_info
);
String
*
sptr
,
*
key
;
DBUG_ENTER
(
"Item_func_aes_decrypt::val_str"
);
sptr
=
args
[
0
]
->
val_str
(
str
);
// String to decrypt
...
...
sql/log_event.cc
View file @
62a26cf8
...
...
@@ -1526,7 +1526,7 @@ void Append_block_log_event::pack_info(String* packet)
length
=
(
uint
)
my_sprintf
(
buf
,
(
buf
,
";file_id=%u;block_len=%u"
,
file_id
,
block_len
));
net_store_data
(
packet
,
buf
,
length
);
net_store_data
(
packet
,
buf
,
(
int32
)
length
);
}
...
...
@@ -1571,7 +1571,7 @@ void Delete_file_log_event::pack_info(String* packet)
char
buf
[
64
];
uint
length
;
length
=
(
uint
)
my_sprintf
(
buf
,
(
buf
,
";file_id=%u"
,
(
uint
)
file_id
));
net_store_data
(
packet
,
buf
,
length
);
net_store_data
(
packet
,
buf
,
(
int32
)
length
);
}
#endif
...
...
@@ -1618,7 +1618,7 @@ void Execute_load_log_event::pack_info(String* packet)
char
buf
[
64
];
uint
length
;
length
=
(
uint
)
my_sprintf
(
buf
,
(
buf
,
";file_id=%u"
,
(
uint
)
file_id
));
net_store_data
(
packet
,
buf
,
length
);
net_store_data
(
packet
,
buf
,
(
int32
)
length
);
}
#endif
...
...
@@ -1659,7 +1659,9 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
mysql_log
.
write
(
thd
,
COM_QUERY
,
"%s"
,
thd
->
query
);
DBUG_PRINT
(
"query"
,(
"%s"
,
thd
->
query
));
mysql_parse
(
thd
,
thd
->
query
,
q_len
);
if
((
expected_error
!=
(
actual_error
=
thd
->
net
.
last_errno
))
&&
DBUG_PRINT
(
"info"
,(
"expected_error: %d last_errno: %d"
,
expected_error
,
thd
->
net
.
last_errno
));
if
((
expected_error
!=
(
actual_error
=
thd
->
net
.
last_errno
))
&&
expected_error
&&
!
ignored_error_code
(
actual_error
)
&&
!
ignored_error_code
(
expected_error
))
...
...
@@ -1675,6 +1677,7 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
else
if
(
expected_error
==
actual_error
||
ignored_error_code
(
actual_error
))
{
DBUG_PRINT
(
"info"
,(
"error ignored"
));
thd
->
query_error
=
0
;
*
rli
->
last_slave_error
=
0
;
rli
->
last_slave_errno
=
0
;
...
...
sql/net_pkg.cc
View file @
62a26cf8
...
...
@@ -31,6 +31,7 @@ void send_error(THD *thd, uint sql_errno, const char *err)
net
->
last_error
:
"NULL"
));
query_cache_abort
(
net
);
thd
->
query_error
=
1
;
// needed to catch query errors during replication
if
(
!
err
)
{
if
(
sql_errno
)
...
...
@@ -132,6 +133,7 @@ net_printf(THD *thd, uint errcode, ...)
DBUG_ENTER
(
"net_printf"
);
DBUG_PRINT
(
"enter"
,(
"message: %u"
,
errcode
));
thd
->
query_error
=
1
;
// needed to catch query errors during replication
query_cache_abort
(
net
);
// Safety
va_start
(
args
,
errcode
);
/*
...
...
sql/sql_acl.cc
View file @
62a26cf8
...
...
@@ -644,7 +644,7 @@ static void acl_update_user(const char *user, const char *host,
{
if
(
!
acl_user
->
host
.
hostname
&&
!
host
[
0
]
||
acl_user
->
host
.
hostname
&&
!
my_strcasecmp
(
host
,
acl_user
->
host
.
hostname
))
!
my_strcasecmp
(
system_charset_info
,
host
,
acl_user
->
host
.
hostname
))
{
acl_user
->
access
=
privileges
;
if
(
mqh
->
bits
&
1
)
...
...
@@ -733,7 +733,8 @@ static void acl_update_db(const char *user, const char *host, const char *db,
!
strcmp
(
user
,
acl_db
->
user
))
{
if
(
!
acl_db
->
host
.
hostname
&&
!
host
[
0
]
||
acl_db
->
host
.
hostname
&&
!
my_strcasecmp
(
host
,
acl_db
->
host
.
hostname
))
acl_db
->
host
.
hostname
&&
!
my_strcasecmp
(
system_charset_info
,
host
,
acl_db
->
host
.
hostname
))
{
if
(
!
acl_db
->
db
&&
!
db
[
0
]
||
acl_db
->
db
&&
!
strcmp
(
db
,
acl_db
->
db
))
...
...
@@ -1010,7 +1011,7 @@ bool check_change_password(THD *thd, const char *host, const char *user)
}
if
(
!
thd
->
slave_thread
&&
(
strcmp
(
thd
->
user
,
user
)
||
my_strcasecmp
(
system_charset_info
,
host
,
thd
->
host_or_ip
)))
my_strcasecmp
(
system_charset_info
,
host
,
thd
->
host_or_ip
)))
{
if
(
check_access
(
thd
,
UPDATE_ACL
,
"mysql"
,
0
,
1
))
return
(
1
);
...
...
@@ -1662,7 +1663,6 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
char
helping
[
NAME_LEN
*
2
+
USERNAME_LENGTH
+
3
];
uint
len
;
GRANT_TABLE
*
grant_table
,
*
found
=
0
;
safe_mutex_assert_owner
(
&
LOCK_grant
);
len
=
(
uint
)
(
strmov
(
strmov
(
strmov
(
helping
,
user
)
+
1
,
db
)
+
1
,
tname
)
-
helping
)
+
1
;
for
(
grant_table
=
(
GRANT_TABLE
*
)
hash_search
(
&
hash_tables
,(
byte
*
)
helping
,
...
...
@@ -1672,7 +1672,8 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
{
if
(
exact
)
{
if
((
host
&&
!
my_strcasecmp
(
host
,
grant_table
->
host
))
||
if
((
host
&&
!
my_strcasecmp
(
system_charset_info
,
host
,
grant_table
->
host
))
||
(
ip
&&
!
strcmp
(
ip
,
grant_table
->
host
)))
return
grant_table
;
}
...
...
@@ -1872,7 +1873,6 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
int
error
=
0
;
ulong
store_table_rights
,
store_col_rights
;
DBUG_ENTER
(
"replace_table_table"
);
safe_mutex_assert_owner
(
&
LOCK_grant
);
strxmov
(
grantor
,
thd
->
user
,
"@"
,
thd
->
host_or_ip
,
NullS
);
...
...
@@ -2734,7 +2734,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
if
(
!
(
host
=
acl_user
->
host
.
hostname
))
host
=
"%"
;
if
(
!
strcmp
(
lex_user
->
user
.
str
,
user
)
&&
!
my_strcasecmp
(
lex_user
->
host
.
str
,
host
))
!
my_strcasecmp
(
system_charset_info
,
lex_user
->
host
.
str
,
host
))
break
;
}
if
(
counter
==
acl_users
.
elements
)
...
...
@@ -2881,7 +2881,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
host
=
""
;
if
(
!
strcmp
(
lex_user
->
user
.
str
,
user
)
&&
!
my_strcasecmp
(
lex_user
->
host
.
str
,
host
))
!
my_strcasecmp
(
system_charset_info
,
lex_user
->
host
.
str
,
host
))
{
want_access
=
acl_db
->
access
;
if
(
want_access
)
...
...
@@ -2940,7 +2940,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
host
=
""
;
if
(
!
strcmp
(
lex_user
->
user
.
str
,
user
)
&&
!
my_strcasecmp
(
lex_user
->
host
.
str
,
host
))
!
my_strcasecmp
(
system_charset_info
,
lex_user
->
host
.
str
,
host
))
{
want_access
=
grant_table
->
privs
;
if
((
want_access
|
grant_table
->
cols
)
!=
0
)
...
...
sql/sql_lex.cc
View file @
62a26cf8
...
...
@@ -1082,7 +1082,7 @@ bool st_select_lex_unit::create_total_list_n_last_return(THD *thd, st_lex *lex,
for
(
cursor
=
**
result
;
cursor
;
cursor
=
cursor
->
next
)
if
(
!
strcmp
(
cursor
->
db
,
aux
->
db
)
&&
!
strcmp
(
cursor
->
real_name
,
aux
->
real_name
)
&&
!
strcmp
(
cursor
->
name
,
aux
->
name
))
!
strcmp
(
cursor
->
alias
,
aux
->
alias
))
break
;
if
(
!
cursor
)
{
...
...
sql/sql_parse.cc
View file @
62a26cf8
...
...
@@ -1460,7 +1460,7 @@ mysql_execute_command(THD *thd)
if
(
check_global_access
(
thd
,
REPL_SLAVE_ACL
))
goto
error
;
#ifndef WORKING_NEW_MASTER
net_printf
(
&
thd
->
net
,
ER_NOT_SUPPORTED_YET
,
"SHOW NEW MASTER"
);
net_printf
(
thd
,
ER_NOT_SUPPORTED_YET
,
"SHOW NEW MASTER"
);
res
=
1
;
#else
res
=
show_new_master
(
thd
);
...
...
sql/sql_prepare.cc
View file @
62a26cf8
...
...
@@ -351,9 +351,10 @@ static int check_prepare_fields(THD *thd,TABLE *table, List<Item> &fields,
}
TABLE_LIST
table_list
;
bzero
((
char
*
)
&
table_list
,
sizeof
(
table_list
));
table_list
.
name
=
table
->
table_name
;
table_list
.
table
=
table
;
table_list
.
grant
=
table
->
grant
;
table_list
.
db
=
table
->
table_cache_key
;
table_list
.
real_name
=
table_list
.
alias
=
table
->
table_name
;
table_list
.
table
=
table
;
table_list
.
grant
=
table
->
grant
;
thd
->
dupp_field
=
0
;
if
(
setup_tables
(
&
table_list
)
||
...
...
sql/time.cc
View file @
62a26cf8
...
...
@@ -418,13 +418,28 @@ ulong convert_month_to_period(ulong month)
}
/*****************************************************************************
** convert a timestamp string to a TIME value.
** At least the following formats are recogniced (based on number of digits)
** YYMMDD, YYYYMMDD, YYMMDDHHMMSS, YYYYMMDDHHMMSS
** YY-MM-DD, YYYY-MM-DD, YY-MM-DD HH.MM.SS
** Returns the type of string
*****************************************************************************/
/*
Convert a timestamp string to a TIME value.
SYNOPSIS
str_to_TIME()
str String to parse
length Length of string
l_time Date is stored here
fuzzy_date 1 if we should allow dates where one part is zero
DESCRIPTION
At least the following formats are recogniced (based on number of digits)
YYMMDD, YYYYMMDD, YYMMDDHHMMSS, YYYYMMDDHHMMSS
YY-MM-DD, YYYY-MM-DD, YY-MM-DD HH.MM.SS
YYYYMMDDTHHMMSS where T is a the character T (ISO8601)
Also dates where all parts are zero are allowed
RETURN VALUES
TIMESTAMP_NONE String wasn't a timestamp
TIMESTAMP_DATE DATE string (YY MM and DD parts ok)
TIMESTAMP_FULL Full timestamp
*/
timestamp_type
str_to_TIME
(
const
char
*
str
,
uint
length
,
TIME
*
l_time
,
bool
fuzzy_date
)
...
...
@@ -441,9 +456,9 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date)
if
(
str
==
end
)
DBUG_RETURN
(
TIMESTAMP_NONE
);
/*
**
calculate first number of digits.
**
If length= 8 or >= 14 then year is of format YYYY.
(YYYY-MM-DD, YYYYMMDD, YYYYYMMDDHHMMSS)
calculate first number of digits.
If length= 8 or >= 14 then year is of format YYYY.
(YYYY-MM-DD, YYYYMMDD, YYYYYMMDDHHMMSS)
*/
for
(
pos
=
str
;
pos
!=
end
&&
my_isdigit
(
system_charset_info
,
*
pos
)
;
pos
++
)
;
digits
=
(
uint
)
(
pos
-
str
);
...
...
@@ -453,7 +468,8 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date)
for
(
i
=
0
;
i
<
6
&&
str
!=
end
&&
my_isdigit
(
system_charset_info
,
*
str
)
;
i
++
)
{
uint
tmp_value
=
(
uint
)
(
uchar
)
(
*
str
++
-
'0'
);
while
(
str
!=
end
&&
my_isdigit
(
system_charset_info
,
str
[
0
])
&&
field_length
--
)
while
(
str
!=
end
&&
my_isdigit
(
system_charset_info
,
str
[
0
])
&&
field_length
--
)
{
tmp_value
=
tmp_value
*
10
+
(
uint
)
(
uchar
)
(
*
str
-
'0'
);
str
++
;
...
...
@@ -483,7 +499,8 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date)
str
++
;
uint
tmp_value
=
(
uint
)
(
uchar
)
(
*
str
-
'0'
);
field_length
=
3
;
while
(
str
++
!=
end
&&
my_isdigit
(
system_charset_info
,
str
[
0
])
&&
field_length
--
)
while
(
str
++
!=
end
&&
my_isdigit
(
system_charset_info
,
str
[
0
])
&&
field_length
--
)
tmp_value
=
tmp_value
*
10
+
(
uint
)
(
uchar
)
(
*
str
-
'0'
);
date
[
6
]
=
tmp_value
;
not_zero_date
|=
tmp_value
;
...
...
@@ -505,7 +522,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date)
{
for
(;
str
!=
end
;
str
++
)
{
if
(
!
isspace
(
*
str
))
if
(
!
my_isspace
(
system_charset_info
,
*
str
))
{
not_zero_date
=
1
;
// Give warning
break
;
...
...
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