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
d409547d
Commit
d409547d
authored
Oct 20, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed function name to prevent injection wrong code from 4.1 (WL#2133)
parent
4714a6e7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
45 deletions
+39
-45
mysql-test/r/rpl_rotate_logs.result
mysql-test/r/rpl_rotate_logs.result
+1
-1
mysql-test/t/rpl_rotate_logs.test
mysql-test/t/rpl_rotate_logs.test
+1
-1
sql/log_event.cc
sql/log_event.cc
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+2
-2
sql/protocol.cc
sql/protocol.cc
+6
-6
sql/protocol.h
sql/protocol.h
+2
-1
sql/sql_class.h
sql/sql_class.h
+0
-2
sql/sql_parse.cc
sql/sql_parse.cc
+24
-29
sql/sql_repl.cc
sql/sql_repl.cc
+2
-2
No files found.
mysql-test/r/rpl_rotate_logs.result
View file @
d409547d
drop table if exists t1, t2, t3, t4;
drop table if exists t1, t2, t3, t4;
start slave;
ERROR HY000:
Could not initialize master info structure; more error messages can be found in the MySQL error log
ERROR HY000:
File '/home/bell/mysql/bk/work-error-5.0/mysql-test/var/slave-data/master.info' not found (Errcode: 13)
start slave;
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
...
...
mysql-test/t/rpl_rotate_logs.test
View file @
d409547d
...
...
@@ -23,7 +23,7 @@ drop table if exists t1, t2, t3, t4;
# START SLAVE will fail because it can't read the file (mode 000)
# (system error 13)
--
error
1
201
--
error
1
105
start
slave
;
system
chmod
600
var
/
slave
-
data
/
master
.
info
;
# It will fail again because the file is empty so the slave cannot get valuable
...
...
sql/log_event.cc
View file @
d409547d
...
...
@@ -2587,7 +2587,7 @@ Slave: load data infile on table '%s' at log position %s in log \
my_afree
(
load_data_query
);
if
(
thd
->
query_error
)
{
/* this err/sql_errno code is copy-paste from send_error() */
/* this err/sql_errno code is copy-paste from
net_
send_error() */
const
char
*
err
;
int
sql_errno
;
if
((
err
=
thd
->
net
.
last_error
)[
0
])
...
...
sql/mysqld.cc
View file @
d409547d
...
...
@@ -1331,7 +1331,7 @@ void close_connection(THD *thd, uint errcode, bool lock)
if
((
vio
=
thd
->
net
.
vio
)
!=
0
)
{
if
(
errcode
)
send_error
(
thd
,
errcode
,
ER
(
errcode
));
/* purecov: inspected */
net_send_error
(
thd
,
errcode
,
ER
(
errcode
));
/* purecov: inspected */
vio_close
(
vio
);
/* vio is freed in delete thd */
}
if
(
lock
)
...
...
@@ -3396,7 +3396,7 @@ static void create_new_thread(THD *thd)
thd
->
killed
=
THD
::
KILL_CONNECTION
;
// Safety
(
void
)
pthread_mutex_unlock
(
&
LOCK_thread_count
);
statistic_increment
(
aborted_connects
,
&
LOCK_status
);
net_printf
(
thd
,
ER_CANT_CREATE_THREAD
,
error
);
net_printf
_error
(
thd
,
ER_CANT_CREATE_THREAD
,
error
);
(
void
)
pthread_mutex_lock
(
&
LOCK_thread_count
);
close_connection
(
thd
,
0
,
0
);
delete
thd
;
...
...
sql/protocol.cc
View file @
d409547d
...
...
@@ -53,14 +53,14 @@ bool Protocol_prep::net_store_data(const char *from, uint length)
/* Send a error string to client */
void
send_error
(
THD
*
thd
,
uint
sql_errno
,
const
char
*
err
)
void
net_
send_error
(
THD
*
thd
,
uint
sql_errno
,
const
char
*
err
)
{
#ifndef EMBEDDED_LIBRARY
uint
length
;
char
buff
[
MYSQL_ERRMSG_SIZE
+
2
],
*
pos
;
#endif
NET
*
net
=
&
thd
->
net
;
DBUG_ENTER
(
"send_error"
);
DBUG_ENTER
(
"
net_
send_error"
);
DBUG_PRINT
(
"enter"
,(
"sql_errno: %d err: %s"
,
sql_errno
,
err
?
err
:
net
->
last_error
[
0
]
?
net
->
last_error
:
"NULL"
));
...
...
@@ -169,7 +169,7 @@ void send_warning(THD *thd, uint sql_errno, const char *err)
*/
void
net_printf
(
THD
*
thd
,
uint
errcode
,
...)
net_printf
_error
(
THD
*
thd
,
uint
errcode
,
...)
{
va_list
args
;
uint
length
,
offset
;
...
...
@@ -182,7 +182,7 @@ net_printf(THD *thd, uint errcode, ...)
#endif
NET
*
net
=
&
thd
->
net
;
DBUG_ENTER
(
"net_printf"
);
DBUG_ENTER
(
"net_printf
_error
"
);
DBUG_PRINT
(
"enter"
,(
"message: %u"
,
errcode
));
if
(
thd
->
spcont
&&
thd
->
spcont
->
find_handler
(
errcode
,
...
...
@@ -196,8 +196,8 @@ net_printf(THD *thd, uint errcode, ...)
#endif
va_start
(
args
,
errcode
);
/*
The following is needed to make net_printf
() work with 0 argument for
errorcode and use the argument after that as the format string. This
The following is needed to make net_printf
_error() work with 0 argument
for
errorcode and use the argument after that as the format string. This
is useful for rare errors that are not worth the hassle to put in
errmsg.sys, but at the same time, the message is not fixed text
*/
...
...
sql/protocol.h
View file @
d409547d
...
...
@@ -172,7 +172,8 @@ class Protocol_cursor :public Protocol_simple
};
void
send_warning
(
THD
*
thd
,
uint
sql_errno
,
const
char
*
err
=
0
);
void
net_printf
(
THD
*
thd
,
uint
sql_errno
,
...);
void
net_printf_error
(
THD
*
thd
,
uint
sql_errno
,
...);
void
net_send_error
(
THD
*
thd
,
uint
sql_errno
=
0
,
const
char
*
err
=
0
);
void
send_ok
(
THD
*
thd
,
ha_rows
affected_rows
=
0L
,
ulonglong
id
=
0L
,
const
char
*
info
=
0
);
void
send_eof
(
THD
*
thd
,
bool
no_flush
=
0
);
...
...
sql/sql_class.h
View file @
d409547d
...
...
@@ -1196,8 +1196,6 @@ class sql_exchange :public Sql_alloc
class
JOIN
;
void
send_error
(
THD
*
thd
,
uint
sql_errno
=
0
,
const
char
*
err
=
0
);
class
select_result
:
public
Sql_alloc
{
protected:
THD
*
thd
;
...
...
sql/sql_parse.cc
View file @
d409547d
...
...
@@ -165,7 +165,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
my_malloc
(
sizeof
(
struct
user_conn
)
+
temp_len
+
1
,
MYF
(
MY_WME
)))))
{
send_error
(
thd
,
0
,
NullS
);
// Out of memory
net_
send_error
(
thd
,
0
,
NullS
);
// Out of memory
return_val
=
1
;
goto
end
;
}
...
...
@@ -183,7 +183,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
if
(
my_hash_insert
(
&
hash_user_connections
,
(
byte
*
)
uc
))
{
my_free
((
char
*
)
uc
,
0
);
send_error
(
thd
,
0
,
NullS
);
// Out of memory
net_
send_error
(
thd
,
0
,
NullS
);
// Out of memory
return_val
=
1
;
goto
end
;
}
...
...
@@ -258,7 +258,7 @@ int check_user(THD *thd, enum enum_server_command command,
*/
if
(
opt_secure_auth_local
&&
passwd_len
==
SCRAMBLE_LENGTH_323
)
{
net_printf
(
thd
,
ER_NOT_SUPPORTED_AUTH_MODE
);
net_printf
_error
(
thd
,
ER_NOT_SUPPORTED_AUTH_MODE
);
mysql_log
.
write
(
thd
,
COM_CONNECT
,
ER
(
ER_NOT_SUPPORTED_AUTH_MODE
));
DBUG_RETURN
(
-
1
);
}
...
...
@@ -290,8 +290,8 @@ int check_user(THD *thd, enum enum_server_command command,
NET
*
net
=
&
thd
->
net
;
if
(
opt_secure_auth_local
)
{
net_printf
(
thd
,
ER_SERVER_IS_IN_SECURE_AUTH_MODE
,
thd
->
user
,
thd
->
host_or_ip
);
net_printf
_error
(
thd
,
ER_SERVER_IS_IN_SECURE_AUTH_MODE
,
thd
->
user
,
thd
->
host_or_ip
);
mysql_log
.
write
(
thd
,
COM_CONNECT
,
ER
(
ER_SERVER_IS_IN_SECURE_AUTH_MODE
),
thd
->
user
,
thd
->
host_or_ip
);
DBUG_RETURN
(
-
1
);
...
...
@@ -330,7 +330,7 @@ int check_user(THD *thd, enum enum_server_command command,
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
if
(
!
count_ok
)
{
// too many connections
send_error
(
thd
,
ER_CON_COUNT_ERROR
);
net_
send_error
(
thd
,
ER_CON_COUNT_ERROR
);
DBUG_RETURN
(
-
1
);
}
}
...
...
@@ -380,14 +380,14 @@ int check_user(THD *thd, enum enum_server_command command,
}
else
if
(
res
==
2
)
// client gave short hash, server has long hash
{
net_printf
(
thd
,
ER_NOT_SUPPORTED_AUTH_MODE
);
net_printf
_error
(
thd
,
ER_NOT_SUPPORTED_AUTH_MODE
);
mysql_log
.
write
(
thd
,
COM_CONNECT
,
ER
(
ER_NOT_SUPPORTED_AUTH_MODE
));
DBUG_RETURN
(
-
1
);
}
net_printf
(
thd
,
ER_ACCESS_DENIED_ERROR
,
thd
->
user
,
thd
->
host_or_ip
,
passwd_len
?
ER
(
ER_YES
)
:
ER
(
ER_NO
));
net_printf
_error
(
thd
,
ER_ACCESS_DENIED_ERROR
,
thd
->
user
,
thd
->
host_or_ip
,
passwd_len
?
ER
(
ER_YES
)
:
ER
(
ER_NO
));
mysql_log
.
write
(
thd
,
COM_CONNECT
,
ER
(
ER_ACCESS_DENIED_ERROR
),
thd
->
user
,
thd
->
host_or_ip
,
...
...
@@ -450,16 +450,16 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc)
if
(
max_user_connections
&&
max_user_connections
<
(
uint
)
uc
->
connections
)
{
net_printf
(
thd
,
ER_TOO_MANY_USER_CONNECTIONS
,
uc
->
user
);
net_printf
_error
(
thd
,
ER_TOO_MANY_USER_CONNECTIONS
,
uc
->
user
);
error
=
1
;
goto
end
;
}
if
(
uc
->
user_resources
.
connections
&&
uc
->
user_resources
.
connections
<=
uc
->
conn_per_hour
)
{
net_printf
(
thd
,
ER_USER_LIMIT_REACHED
,
uc
->
user
,
"max_connections"
,
(
long
)
uc
->
user_resources
.
connections
);
net_printf
_error
(
thd
,
ER_USER_LIMIT_REACHED
,
uc
->
user
,
"max_connections"
,
(
long
)
uc
->
user_resources
.
connections
);
error
=
1
;
goto
end
;
}
...
...
@@ -585,8 +585,8 @@ static bool check_mqh(THD *thd, uint check_command)
if
(
uc
->
user_resources
.
questions
&&
uc
->
questions
++
>=
uc
->
user_resources
.
questions
)
{
net_printf
(
thd
,
ER_USER_LIMIT_REACHED
,
uc
->
user
,
"max_questions"
,
(
long
)
uc
->
user_resources
.
questions
);
net_printf
_error
(
thd
,
ER_USER_LIMIT_REACHED
,
uc
->
user
,
"max_questions"
,
(
long
)
uc
->
user_resources
.
questions
);
error
=
1
;
goto
end
;
}
...
...
@@ -596,8 +596,8 @@ static bool check_mqh(THD *thd, uint check_command)
if
(
uc
->
user_resources
.
updates
&&
uc_update_queries
[
check_command
]
&&
uc
->
updates
++
>=
uc
->
user_resources
.
updates
)
{
net_printf
(
thd
,
ER_USER_LIMIT_REACHED
,
uc
->
user
,
"max_updates"
,
(
long
)
uc
->
user_resources
.
updates
);
net_printf
_error
(
thd
,
ER_USER_LIMIT_REACHED
,
uc
->
user
,
"max_updates"
,
(
long
)
uc
->
user_resources
.
updates
);
error
=
1
;
goto
end
;
}
...
...
@@ -1001,7 +1001,7 @@ pthread_handler_decl(handle_one_connection,arg)
if
((
error
=
check_connection
(
thd
)))
{
// Wrong permissions
if
(
error
>
0
)
net_printf
(
thd
,
error
,
thd
->
host_or_ip
);
net_printf
_error
(
thd
,
error
,
thd
->
host_or_ip
);
#ifdef __NT__
if
(
vio_type
(
net
->
vio
)
==
VIO_TYPE_NAMEDPIPE
)
my_sleep
(
1000
);
/* must wait after eof() */
...
...
@@ -1044,7 +1044,7 @@ pthread_handler_decl(handle_one_connection,arg)
thd
->
host_or_ip
,
(
net
->
last_errno
?
ER
(
net
->
last_errno
)
:
ER
(
ER_UNKNOWN_ERROR
)));
send_error
(
thd
,
net
->
last_errno
,
NullS
);
net_send_error
(
thd
,
net
->
last_errno
,
NullS
);
statistic_increment
(
aborted_threads
,
&
LOCK_status
);
}
else
if
(
thd
->
killed
)
...
...
@@ -1113,7 +1113,7 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg)
uint
length
=
(
uint
)
strlen
(
buff
);
if
(
buff
[
length
-
1
]
!=
'\n'
&&
!
feof
(
file
))
{
send_error
(
thd
,
ER_NET_PACKET_TOO_LARGE
,
NullS
);
net_send_error
(
thd
,
ER_NET_PACKET_TOO_LARGE
,
NullS
);
thd
->
is_fatal_error
=
1
;
break
;
}
...
...
@@ -1267,7 +1267,7 @@ bool do_command(THD *thd)
statistic_increment
(
aborted_threads
,
&
LOCK_status
);
DBUG_RETURN
(
TRUE
);
// We have to close it.
}
send_error
(
thd
,
net
->
last_errno
,
NullS
);
net_send_error
(
thd
,
net
->
last_errno
,
NullS
);
net
->
error
=
0
;
DBUG_RETURN
(
FALSE
);
}
...
...
@@ -1808,7 +1808,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if
(
thd
->
killed_errno
()
&&
!
thd
->
net
.
report_error
)
thd
->
send_kill_message
();
if
(
thd
->
is_fatal_error
||
thd
->
net
.
report_error
)
send_error
(
thd
);
net_
send_error
(
thd
);
time_t
start_of_query
=
thd
->
start_time
;
thd
->
end_time
();
// Set start time
...
...
@@ -3671,10 +3671,6 @@ mysql_execute_command(THD *thd)
goto
error
;
#ifndef EMBEDDED_LIBRARY
/*
When executing substatements, they're assumed to send_error when
it happens, but not to send_ok.
*/
my_bool
nsok
=
thd
->
net
.
no_send_ok
;
thd
->
net
.
no_send_ok
=
TRUE
;
#endif
...
...
@@ -3932,7 +3928,6 @@ mysql_execute_command(THD *thd)
DBUG_RETURN
(
res
||
thd
->
net
.
report_error
);
error:
/* We end up here if send_error() has already been done. */
DBUG_RETURN
(
TRUE
);
}
...
...
sql/sql_repl.cc
View file @
d409547d
...
...
@@ -867,7 +867,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
if
(
slave_errno
)
{
if
(
net_report
)
send_error
(
thd
,
slave_errno
);
my_error
(
slave_errno
,
MYF
(
0
)
);
DBUG_RETURN
(
1
);
}
else
if
(
net_report
)
...
...
@@ -917,7 +917,7 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
if
(
slave_errno
)
{
if
(
net_report
)
send_error
(
thd
,
slave_errno
);
my_error
(
slave_errno
,
MYF
(
0
)
);
return
1
;
}
else
if
(
net_report
)
...
...
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