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
3d31b8ee
Commit
3d31b8ee
authored
Feb 25, 2009
by
Patrick Crews
Browse files
Options
Browse Files
Download
Plain Diff
merge.
parents
30c65aae
fcc9e3d2
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
198 additions
and
113 deletions
+198
-113
include/my_getopt.h
include/my_getopt.h
+1
-1
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+9
-0
mysql-test/include/handler.inc
mysql-test/include/handler.inc
+26
-0
mysql-test/r/handler_innodb.result
mysql-test/r/handler_innodb.result
+9
-0
mysql-test/r/handler_myisam.result
mysql-test/r/handler_myisam.result
+9
-0
mysql-test/r/mysqlbinlog.result
mysql-test/r/mysqlbinlog.result
+11
-11
mysql-test/t/mysqlbinlog.test
mysql-test/t/mysqlbinlog.test
+21
-21
mysys/default.c
mysys/default.c
+5
-5
mysys/my_getopt.c
mysys/my_getopt.c
+9
-5
sql/log_event.cc
sql/log_event.cc
+1
-1
sql/mysql_priv.h
sql/mysql_priv.h
+2
-1
sql/mysqld.cc
sql/mysqld.cc
+85
-54
sql/sql_handler.cc
sql/sql_handler.cc
+7
-12
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+1
-2
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+2
-0
No files found.
include/my_getopt.h
View file @
3d31b8ee
...
...
@@ -72,7 +72,7 @@ extern void my_cleanup_options(const struct my_option *options);
extern
void
my_print_help
(
const
struct
my_option
*
options
);
extern
void
my_print_variables
(
const
struct
my_option
*
options
);
extern
void
my_getopt_register_get_addr
(
uchar
**
(
*
func_addr
)(
const
char
*
,
uint
,
const
struct
my_option
*
));
const
struct
my_option
*
,
int
*
));
ulonglong
getopt_ull_limit_value
(
ulonglong
num
,
const
struct
my_option
*
optp
,
my_bool
*
fix
);
...
...
libmysqld/lib_sql.cc
View file @
3d31b8ee
...
...
@@ -43,6 +43,15 @@ extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
static
my_bool
emb_read_query_result
(
MYSQL
*
mysql
);
extern
"C"
void
unireg_clear
(
int
exit_code
)
{
DBUG_ENTER
(
"unireg_clear"
);
clean_up
(
!
opt_help
&&
(
exit_code
||
!
opt_bootstrap
));
/* purecov: inspected */
my_end
(
opt_endinfo
?
MY_CHECK_ERROR
|
MY_GIVE_INFO
:
0
);
DBUG_VOID_RETURN
;
}
/*
Reads error information from the MYSQL_DATA and puts
it into proper MYSQL members
...
...
mysql-test/include/handler.inc
View file @
3d31b8ee
...
...
@@ -692,3 +692,29 @@ unlock tables;
drop
table
t1
;
--
error
ER_UNKNOWN_TABLE
handler
t1
read
a
next
;
#
# Bug#41110: crash with handler command when used concurrently with alter table
# Bug#41112: crash in mysql_ha_close_table/get_lock_data with alter table
#
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
);
handler
t1
open
;
connect
(
con1
,
localhost
,
root
,,);
send
alter
table
t1
engine
=
memory
;
connection
default
;
let
$wait_condition
=
select
count
(
*
)
=
1
from
information_schema
.
processlist
where
state
=
"rename result table"
and
info
=
"alter table t1 engine=memory"
;
--
source
include
/
wait_condition
.
inc
--
error
ER_ILLEGAL_HA
handler
t1
read
a
next
;
handler
t1
close
;
connection
con1
;
--
reap
drop
table
t1
;
connection
default
;
mysql-test/r/handler_innodb.result
View file @
3d31b8ee
...
...
@@ -730,3 +730,12 @@ unlock tables;
drop table t1;
handler t1 read a next;
ERROR 42S02: Unknown table 't1' in HANDLER
drop table if exists t1;
create table t1 (a int);
insert into t1 values (1);
handler t1 open;
alter table t1 engine=memory;
handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
handler t1 close;
drop table t1;
mysql-test/r/handler_myisam.result
View file @
3d31b8ee
...
...
@@ -728,3 +728,12 @@ unlock tables;
drop table t1;
handler t1 read a next;
ERROR 42S02: Unknown table 't1' in HANDLER
drop table if exists t1;
create table t1 (a int);
insert into t1 values (1);
handler t1 open;
alter table t1 engine=memory;
handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
handler t1 close;
drop table t1;
mysql-test/r/mysqlbinlog.result
View file @
3d31b8ee
...
...
@@ -411,17 +411,6 @@ drop table t1;
1
drop table t1;
shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
set @@global.server_id= 4294967295;
reset master;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
is not null;
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
is not null
1
*** Unsigned server_id 4294967295 is found: 1 ***
set @@global.server_id= 1;
End of 5.0 tests
flush logs;
BUG#31611: Security risk with BINLOG statement
SET BINLOG_FORMAT=ROW;
...
...
@@ -471,4 +460,15 @@ an_int 1000
a_decimal 907.79
a_string Just a test
DROP TABLE t1;
set @@global.server_id= 4294967295;
reset master;
flush logs;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
is not null;
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
is not null
1
*** Unsigned server_id 4294967295 is found: 1 ***
set @@global.server_id= 1;
End of 5.1 tests
mysql-test/t/mysqlbinlog.test
View file @
3d31b8ee
...
...
@@ -278,27 +278,6 @@ echo shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
error
1
;
exec
$MYSQL_BINLOG
$MYSQL_TEST_DIR
/
std_data
/
corrupt
-
relay
-
bin
.
000624
>
$MYSQLTEST_VARDIR
/
tmp
/
bug31793
.
sql
;
#
# Bug #37313 BINLOG Contains Incorrect server id
#
let
$save_server_id
=
`select @@global.server_id`
;
let
$s_id_max
=
`select (1 << 32) - 1`
;
eval
set
@@
global
.
server_id
=
$s_id_max
;
reset
master
;
--
exec
$MYSQL_BINLOG
$MYSQLTEST_VARDIR
/
log
/
master
-
bin
.
000001
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqlbinlog_bug37313
.
binlog
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
select
(
@
a
:=
load_file
(
"
$MYSQLTEST_VARDIR
/tmp/mysqlbinlog_bug37313.binlog"
))
is
not
null
;
let
$s_id_unsigned
=
`select @a like "%server id $s_id_max%" /* must return 1 */`
;
echo
***
Unsigned
server_id
$s_id_max
is
found
:
$s_id_unsigned
***
;
eval
set
@@
global
.
server_id
=
$save_server_id
;
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqlbinlog_bug37313
.
binlog
--
echo
End
of
5.0
tests
#
# Test --disable-force-if-open and --force-if-open
...
...
@@ -363,4 +342,25 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug32580.sql;
query_vertical
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
#
# Bug #37313 BINLOG Contains Incorrect server id
#
let
$save_server_id
=
`select @@global.server_id`
;
let
$s_id_max
=
`select (1 << 32) - 1`
;
eval
set
@@
global
.
server_id
=
$s_id_max
;
reset
master
;
flush
logs
;
--
exec
$MYSQL_BINLOG
$MYSQLD_DATADIR
/
master
-
bin
.
000001
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqlbinlog_bug37313
.
binlog
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
select
(
@
a
:=
load_file
(
"
$MYSQLTEST_VARDIR
/tmp/mysqlbinlog_bug37313.binlog"
))
is
not
null
;
let
$s_id_unsigned
=
`select @a like "%server id $s_id_max%" /* must return 1 */`
;
echo
***
Unsigned
server_id
$s_id_max
is
found
:
$s_id_unsigned
***
;
eval
set
@@
global
.
server_id
=
$save_server_id
;
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqlbinlog_bug37313
.
binlog
--
echo
End
of
5.1
tests
mysys/default.c
View file @
3d31b8ee
...
...
@@ -144,6 +144,7 @@ static char *remove_end_comment(char *ptr);
RETURN
0 ok
1 given cinf_file doesn't exist
2 out of memory
The global variable 'my_defaults_group_suffix' is updated with value for
--defaults_group_suffix
...
...
@@ -190,7 +191,7 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
if
(
!
(
extra_groups
=
(
const
char
**
)
alloc_root
(
ctx
->
alloc
,
(
2
*
group
->
count
+
1
)
*
sizeof
(
char
*
))))
goto
err
;
DBUG_RETURN
(
2
)
;
for
(
i
=
0
;
i
<
group
->
count
;
i
++
)
{
...
...
@@ -199,7 +200,7 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
len
=
strlen
(
extra_groups
[
i
]);
if
(
!
(
ptr
=
alloc_root
(
ctx
->
alloc
,
len
+
instance_len
+
1
)))
goto
err
;
DBUG_RETURN
(
2
)
;
extra_groups
[
i
+
group
->
count
]
=
ptr
;
...
...
@@ -254,12 +255,11 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
}
}
DBUG_RETURN
(
error
);
DBUG_RETURN
(
0
);
err:
fprintf
(
stderr
,
"Fatal error in defaults handling. Program aborted
\n
"
);
exit
(
1
);
return
0
;
/* Keep compiler happy */
DBUG_RETURN
(
1
);
}
...
...
mysys/my_getopt.c
View file @
3d31b8ee
...
...
@@ -100,10 +100,10 @@ static void default_reporter(enum loglevel level,
one. Call function 'get_one_option()' once for each option.
*/
static
uchar
**
(
*
getopt_get_addr
)(
const
char
*
,
uint
,
const
struct
my_option
*
);
static
uchar
**
(
*
getopt_get_addr
)(
const
char
*
,
uint
,
const
struct
my_option
*
,
int
*
);
void
my_getopt_register_get_addr
(
uchar
**
(
*
func_addr
)(
const
char
*
,
uint
,
const
struct
my_option
*
))
const
struct
my_option
*
,
int
*
))
{
getopt_get_addr
=
func_addr
;
}
...
...
@@ -362,8 +362,12 @@ int handle_options(int *argc, char ***argv,
my_progname
,
optp
->
name
);
return
EXIT_NO_ARGUMENT_ALLOWED
;
}
error
=
0
;
value
=
optp
->
var_type
&
GET_ASK_ADDR
?
(
*
getopt_get_addr
)(
key_name
,
(
uint
)
strlen
(
key_name
),
optp
)
:
optp
->
value
;
(
*
getopt_get_addr
)(
key_name
,
(
uint
)
strlen
(
key_name
),
optp
,
&
error
)
:
optp
->
value
;
if
(
error
)
return
error
;
if
(
optp
->
arg_type
==
NO_ARG
)
{
...
...
@@ -1092,7 +1096,7 @@ static void init_variables(const struct my_option *options,
if
(
options
->
value
)
init_one_value
(
options
,
options
->
value
,
options
->
def_value
);
if
(
options
->
var_type
&
GET_ASK_ADDR
&&
(
variable
=
(
*
getopt_get_addr
)(
""
,
0
,
options
)))
(
variable
=
(
*
getopt_get_addr
)(
""
,
0
,
options
,
0
)))
init_one_value
(
options
,
variable
,
options
->
def_value
);
}
DBUG_VOID_RETURN
;
...
...
@@ -1196,7 +1200,7 @@ void my_print_variables(const struct my_option *options)
for
(
optp
=
options
;
optp
->
id
;
optp
++
)
{
uchar
*
*
value
=
(
optp
->
var_type
&
GET_ASK_ADDR
?
(
*
getopt_get_addr
)(
""
,
0
,
optp
)
:
optp
->
value
);
(
*
getopt_get_addr
)(
""
,
0
,
optp
,
0
)
:
optp
->
value
);
if
(
value
)
{
printf
(
"%s "
,
optp
->
name
);
...
...
sql/log_event.cc
View file @
3d31b8ee
...
...
@@ -1258,7 +1258,7 @@ void Log_event::print_header(IO_CACHE* file,
my_b_printf
(
file
,
"#"
);
print_timestamp
(
file
);
my_b_printf
(
file
,
" server id %lu end_log_pos %s "
,
server_id
,
my_b_printf
(
file
,
" server id %lu end_log_pos %s "
,
(
ulong
)
server_id
,
llstr
(
log_pos
,
llbuff
));
/* mysqlbinlog --hexdump */
...
...
sql/mysql_priv.h
View file @
3d31b8ee
...
...
@@ -2411,7 +2411,8 @@ extern "C" void unireg_abort(int exit_code) __attribute__((noreturn));
void
kill_delayed_threads
(
void
);
bool
check_stack_overrun
(
THD
*
thd
,
long
margin
,
uchar
*
dummy
);
#else
#define unireg_abort(exit_code) DBUG_RETURN(exit_code)
extern
"C"
void
unireg_clear
(
int
exit_code
);
#define unireg_abort(exit_code) do { unireg_clear(exit_code); DBUG_RETURN(exit_code); } while(0)
inline
void
kill_delayed_threads
(
void
)
{}
#define check_stack_overrun(A, B, C) 0
#endif
...
...
sql/mysqld.cc
View file @
3d31b8ee
This diff is collapsed.
Click to expand it.
sql/sql_handler.cc
View file @
3d31b8ee
...
...
@@ -160,6 +160,9 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables,
table
->
query_id
=
thd
->
query_id
;
table
->
open_by_handler
=
0
;
}
/* Mark table as closed, ready for re-open if necessary. */
tables
->
table
=
NULL
;
}
/*
...
...
@@ -177,8 +180,7 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables,
'reopen' is set when a handler table is to be re-opened. In this case,
'tables' is the pointer to the hashed TABLE_LIST object which has been
saved on the original open.
'reopen' is also used to suppress the sending of an 'ok' message or
error messages.
'reopen' is also used to suppress the sending of an 'ok' message.
RETURN
FALSE OK
...
...
@@ -214,8 +216,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
strlen
(
tables
->
alias
)
+
1
))
{
DBUG_PRINT
(
"info"
,(
"duplicate '%s'"
,
tables
->
alias
));
if
(
!
reopen
)
my_error
(
ER_NONUNIQ_TABLE
,
MYF
(
0
),
tables
->
alias
);
my_error
(
ER_NONUNIQ_TABLE
,
MYF
(
0
),
tables
->
alias
);
goto
err
;
}
}
...
...
@@ -259,8 +260,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
/* There can be only one table in '*tables'. */
if
(
!
(
tables
->
table
->
file
->
ha_table_flags
()
&
HA_CAN_SQL_HANDLER
))
{
if
(
!
reopen
)
my_error
(
ER_ILLEGAL_HA
,
MYF
(
0
),
tables
->
alias
);
my_error
(
ER_ILLEGAL_HA
,
MYF
(
0
),
tables
->
alias
);
goto
err
;
}
...
...
@@ -479,8 +479,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
if
(
need_reopen
)
{
mysql_ha_close_table
(
thd
,
tables
,
FALSE
);
hash_tables
->
table
=
NULL
;
mysql_ha_close_table
(
thd
,
hash_tables
,
FALSE
);
/*
The lock might have been aborted, we need to manually reset
thd->some_tables_deleted because handler's tables are closed
...
...
@@ -761,11 +760,7 @@ void mysql_ha_flush(THD *thd)
{
hash_tables
=
(
TABLE_LIST
*
)
hash_element
(
&
thd
->
handler_tables_hash
,
i
);
if
(
hash_tables
->
table
&&
hash_tables
->
table
->
needs_reopen_or_name_lock
())
{
mysql_ha_close_table
(
thd
,
hash_tables
,
TRUE
);
/* Mark table as closed, ready for re-open. */
hash_tables
->
table
=
NULL
;
}
}
DBUG_VOID_RETURN
;
...
...
storage/innobase/handler/ha_innodb.cc
View file @
3d31b8ee
...
...
@@ -4252,7 +4252,6 @@ convert_search_mode_to_innobase(
case
HA_READ_MBR_WITHIN
:
case
HA_READ_MBR_DISJOINT
:
case
HA_READ_MBR_EQUAL
:
my_error
(
ER_TABLE_CANT_HANDLE_SPKEYS
,
MYF
(
0
));
return
(
PAGE_CUR_UNSUPP
);
/* do not use "default:" in order to produce a gcc warning:
enumeration value '...' not handled in switch
...
...
@@ -5803,7 +5802,7 @@ ha_innobase::records_in_range(
mode2
);
}
else
{
n_rows
=
0
;
n_rows
=
HA_POS_ERROR
;
}
dtuple_free_for_mysql
(
heap1
);
...
...
storage/myisam/ha_myisam.cc
View file @
3d31b8ee
...
...
@@ -1789,6 +1789,8 @@ int ha_myisam::extra(enum ha_extra_function operation)
{
if
((
specialflag
&
SPECIAL_SAFE_MODE
)
&&
operation
==
HA_EXTRA_KEYREAD
)
return
0
;
if
(
operation
==
HA_EXTRA_MMAP
&&
!
opt_myisam_use_mmap
)
return
0
;
return
mi_extra
(
file
,
operation
,
0
);
}
...
...
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