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
da5713e4
Commit
da5713e4
authored
Feb 03, 2006
by
pappa@c-5c0be253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL #2826: Sixth step, made it work with test cases
parent
3397e693
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
76 additions
and
45 deletions
+76
-45
BUILD/SETUP.sh
BUILD/SETUP.sh
+1
-1
BUILD/compile-pentium-debug-max
BUILD/compile-pentium-debug-max
+2
-2
sql/ha_partition.cc
sql/ha_partition.cc
+4
-4
sql/mysql_priv.h
sql/mysql_priv.h
+12
-9
sql/mysqld.cc
sql/mysqld.cc
+4
-0
sql/set_var.cc
sql/set_var.cc
+2
-1
sql/sql_partition.cc
sql/sql_partition.cc
+46
-25
sql/sql_table.cc
sql/sql_table.cc
+3
-3
sql/table.cc
sql/table.cc
+2
-0
No files found.
BUILD/SETUP.sh
View file @
da5713e4
...
...
@@ -71,7 +71,7 @@ pentium_cflags="$check_cpu_cflags"
pentium64_cflags
=
"
$check_cpu_cflags
-m64"
ppc_cflags
=
"
$check_cpu_cflags
"
sparc_cflags
=
""
error_inject
_flag
=
"--with-error-inject "
error_inject
=
"--with-error-inject "
# be as fast as we can be without losing our ability to backtrace
fast_cflags
=
"-O3 -fno-omit-frame-pointer"
...
...
BUILD/compile-pentium-debug-max
View file @
da5713e4
...
...
@@ -3,9 +3,9 @@
path
=
`
dirname
$0
`
.
"
$path
/SETUP.sh"
$@
--with-debug
=
full
extra_flags
=
"
$pentium_cflags
$debug_cflags
$max_cflags
$error_inject_flag
"
extra_flags
=
"
$pentium_cflags
$debug_cflags
$max_cflags
"
c_warnings
=
"
$c_warnings
$debug_extra_warnings
"
cxx_warnings
=
"
$cxx_warnings
$debug_extra_warnings
"
extra_configs
=
"
$pentium_configs
$debug_configs
$max_configs
"
extra_configs
=
"
$pentium_configs
$debug_configs
$max_configs
$error_inject
"
.
"
$path
/FINISH.sh"
sql/ha_partition.cc
View file @
da5713e4
...
...
@@ -1879,8 +1879,8 @@ bool ha_partition::create_handler_file(const char *name)
{
part_elem
=
part_it
++
;
if
(
part_elem
->
part_state
!=
PART_NORMAL
&&
part_elem
->
part_state
!=
PART_
IS
_ADDED
&&
part_elem
->
part_state
!=
PART_
IS_
CHANGED
)
part_elem
->
part_state
!=
PART_
TO_BE
_ADDED
&&
part_elem
->
part_state
!=
PART_CHANGED
)
continue
;
tablename_to_filename
(
part_elem
->
partition_name
,
part_name
,
FN_REFLEN
);
...
...
@@ -1931,8 +1931,8 @@ bool ha_partition::create_handler_file(const char *name)
{
part_elem
=
part_it
++
;
if
(
part_elem
->
part_state
!=
PART_NORMAL
&&
part_elem
->
part_state
!=
PART_
IS
_ADDED
&&
part_elem
->
part_state
!=
PART_
IS_
CHANGED
)
part_elem
->
part_state
!=
PART_
TO_BE
_ADDED
&&
part_elem
->
part_state
!=
PART_CHANGED
)
continue
;
if
(
!
m_is_sub_partitioned
)
{
...
...
sql/mysql_priv.h
View file @
da5713e4
...
...
@@ -608,9 +608,9 @@ struct Query_cache_query_flags
in various error cases.
*/
#ifndef ERROR_INJECT_SUPPORT
#define ERROR_INJECT
OR(x)
#define ERROR_INJECT
OR_ACTION(x)
#define ERROR_INJECT
OR_CRASH(x)
#define ERROR_INJECT
(x) 0
#define ERROR_INJECT
_ACTION(x) 0
#define ERROR_INJECT
_CRASH(x) 0
#define SET_ERROR_INJECT_CODE(x)
#define SET_ERROR_INJECT_VALUE(x)
#else
...
...
@@ -624,7 +624,7 @@ inline bool
my_error_inject
(
int
error
)
{
THD
*
thd
=
current_thd
;
if
(
thd
->
variables
.
error_inject_code
==
error
)
if
(
thd
->
variables
.
error_inject_code
==
(
uint
)
error
)
{
thd
->
variables
.
error_inject_code
=
0
;
return
1
;
...
...
@@ -632,10 +632,10 @@ my_error_inject(int error)
return
0
;
}
#define ERROR_INJECT
OR
_CRASH(code) \
(my_error_inject((code)) ? ((DBUG_ASSERT(0)), 0) : 0
#define ERROR_INJECT
OR
_ACTION(code, action) \
(my_error_inject((code)) ? ((action), 0) : 0
#define ERROR_INJECT_CRASH(code) \
(my_error_inject((code)) ? ((DBUG_ASSERT(0)), 0) : 0
)
#define ERROR_INJECT_ACTION(code, action) \
(my_error_inject((code)) ? ((action), 0) : 0
)
#define ERROR_INJECT(code) \
(my_error_inject((code)) ? 1 : 0)
#endif
...
...
@@ -1146,7 +1146,7 @@ bool write_log_ph2_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt);
#define WFRM_WRITE_SHADOW 1
#define WFRM_INSTALL_SHADOW 2
#define WFRM_PACK_FRM
#define WFRM_PACK_FRM
4
bool
mysql_write_frm
(
ALTER_PARTITION_PARAM_TYPE
*
lpt
,
uint
flags
);
bool
abort_and_upgrade_lock
(
ALTER_PARTITION_PARAM_TYPE
*
lpt
);
void
close_open_tables_and_downgrade
(
ALTER_PARTITION_PARAM_TYPE
*
lpt
);
...
...
@@ -1317,6 +1317,9 @@ extern ulong delayed_insert_timeout;
extern
ulong
delayed_insert_limit
,
delayed_queue_size
;
extern
ulong
delayed_insert_threads
,
delayed_insert_writes
;
extern
ulong
delayed_rows_in_use
,
delayed_insert_errors
;
#ifdef ERROR_INJECT_SUPPORT
extern
ulong
error_inject_code
,
error_inject_value
;
#endif
extern
ulong
slave_open_temp_tables
;
extern
ulong
query_cache_size
,
query_cache_min_res_unit
;
extern
ulong
slow_launch_threads
,
slow_launch_time
;
...
...
sql/mysqld.cc
View file @
da5713e4
...
...
@@ -503,6 +503,10 @@ ulong aborted_threads, aborted_connects;
ulong
delayed_insert_timeout
,
delayed_insert_limit
,
delayed_queue_size
;
ulong
delayed_insert_threads
,
delayed_insert_writes
,
delayed_rows_in_use
;
ulong
delayed_insert_errors
,
flush_time
;
#ifdef ERROR_INJECT_SUPPORT
ulong
error_inject_code
=
0
;
ulong
error_inject_value
=
0
;
#endif
ulong
specialflag
=
0
;
ulong
binlog_cache_use
=
0
,
binlog_cache_disk_use
=
0
;
ulong
max_connections
,
max_connect_errors
;
...
...
sql/set_var.cc
View file @
da5713e4
...
...
@@ -221,6 +221,7 @@ sys_var_long_ptr sys_error_inject_code("error_inject_code",
sys_var_long_ptr
sys_error_inject_value
(
"error_inject_value"
,
&
error_inject_value
);
#endif
sys_var_event_executor
sys_event_executor
(
"event_scheduler"
,
&
event_executor_running_global_var
);
sys_var_long_ptr
sys_expire_logs_days
(
"expire_logs_days"
,
...
...
sql/sql_partition.cc
View file @
da5713e4
...
...
@@ -2459,6 +2459,7 @@ char *generate_partition_syntax(partition_info *part_info,
if
(
write_all
||
(
!
part_info
->
use_default_partitions
))
{
bool
first
=
TRUE
;
err
+=
add_begin_parenthesis
(
fptr
);
i
=
0
;
do
...
...
@@ -2467,6 +2468,12 @@ char *generate_partition_syntax(partition_info *part_info,
if
(
part_elem
->
part_state
!=
PART_TO_BE_DROPPED
&&
part_elem
->
part_state
!=
PART_REORGED_DROPPED
)
{
if
(
!
first
)
{
err
+=
add_comma
(
fptr
);
err
+=
add_space
(
fptr
);
}
first
=
FALSE
;
err
+=
add_partition
(
fptr
);
err
+=
add_string
(
fptr
,
part_elem
->
partition_name
);
err
+=
add_space
(
fptr
);
...
...
@@ -2496,11 +2503,6 @@ char *generate_partition_syntax(partition_info *part_info,
err
+=
add_end_parenthesis
(
fptr
);
}
while
(
++
j
<
no_subparts
);
}
if
(
i
!=
(
tot_no_parts
-
1
))
{
err
+=
add_comma
(
fptr
);
err
+=
add_space
(
fptr
);
}
}
if
(
i
==
(
tot_no_parts
-
1
))
err
+=
add_end_parenthesis
(
fptr
);
...
...
@@ -5178,6 +5180,25 @@ write_log_ph2_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
}
/*
Remove entry from table log and release resources for others to use
SYNOPSIS
write_log_completed()
lpt Struct containing parameters
RETURN VALUES
TRUE Error
FALSE Success
*/
static
bool
write_log_completed
(
ALTER_PARTITION_PARAM_TYPE
*
lpt
)
{
DBUG_ENTER
(
"write_log_ph2_change_partition"
);
DBUG_RETURN
(
FALSE
);
}
/*
Actually perform the change requested by ALTER TABLE of partitions
previously prepared.
...
...
@@ -5308,8 +5329,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
1) Write the new frm, pack it and then delete it
2) Perform the change within the handler
*/
if
(
(
mysql_write_frm
(
lpt
,
WFRM_WRITE_SHADOW
|
WFRM_PACK_FRM
)
)
||
(
mysql_change_partitions
(
lpt
)
))
if
(
mysql_write_frm
(
lpt
,
WFRM_WRITE_SHADOW
|
WFRM_PACK_FRM
)
||
mysql_change_partitions
(
lpt
))
{
fast_alter_partition_error_handler
(
lpt
);
DBUG_RETURN
(
TRUE
);
...
...
@@ -5370,25 +5391,25 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
to test if recovery is properly done.
*/
if
(
write_log_shadow_frm
(
lpt
,
FALSE
)
||
ERROR_INJECT
OR
_CRASH
(
1000
)
||
ERROR_INJECT_CRASH
(
1000
)
||
mysql_write_frm
(
lpt
,
WFRM_WRITE_SHADOW
)
||
ERROR_INJECT
OR
_CRASH
(
1001
)
||
ERROR_INJECT_CRASH
(
1001
)
||
write_log_drop_partition
(
lpt
)
||
ERROR_INJECT
OR
_CRASH
(
1002
)
||
ERROR_INJECT_CRASH
(
1002
)
||
abort_and_upgrade_lock
(
lpt
)
||
((
!
thd
->
lex
->
no_write_to_binlog
)
&&
write_bin_log
(
thd
,
FALSE
,
thd
->
query
,
thd
->
query_length
),
FALSE
)
||
ERROR_INJECT
OR
_CRASH
(
1003
)
||
(
write_bin_log
(
thd
,
FALSE
,
thd
->
query
,
thd
->
query_length
),
FALSE
)
)
||
ERROR_INJECT_CRASH
(
1003
)
||
mysql_write_frm
(
lpt
,
WFRM_INSTALL_SHADOW
)
||
(
close_open_tables_and_downgrade
(
lpt
),
FALSE
)
||
ERROR_INJECT
OR
_CRASH
(
1004
)
||
ERROR_INJECT_CRASH
(
1004
)
||
table
->
file
->
extra
(
HA_EXTRA_PREPARE_FOR_DELETE
)
||
ERROR_INJECT
OR
_CRASH
(
1005
)
||
ERROR_INJECT_CRASH
(
1005
)
||
mysql_drop_partitions
(
lpt
)
||
ERROR_INJECT
OR
_CRASH
(
1006
)
||
ERROR_INJECT_CRASH
(
1006
)
||
write_log_completed
(
lpt
)
||
ERROR_INJECT
OR
_CRASH
(
1007
)
||
ERROR_INJECT_CRASH
(
1007
)
||
(
mysql_wait_completed_table
(
lpt
,
table
),
FALSE
))
{
fast_alter_partition_error_handler
(
lpt
);
...
...
@@ -5426,25 +5447,25 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
9) Complete query
*/
if
(
write_log_shadow_frm
(
lpt
,
FALSE
)
||
ERROR_INJECT
ED
_CRASH
(
1010
)
||
ERROR_INJECT_CRASH
(
1010
)
||
mysql_write_frm
(
lpt
,
WFRM_WRITE_SHADOW
)
||
ERROR_INJECT
ED
_CRASH
(
1011
)
||
ERROR_INJECT_CRASH
(
1011
)
||
write_log_add_partition
(
lpt
)
||
ERROR_INJECT
ED
_CRASH
(
1012
)
||
ERROR_INJECT_CRASH
(
1012
)
||
mysql_change_partitions
(
lpt
)
||
ERROR_INJECT
ED
_CRASH
(
1013
)
||
ERROR_INJECT_CRASH
(
1013
)
||
abort_and_upgrade_lock
(
lpt
)
||
((
!
thd
->
lex
->
no_write_to_binlog
)
&&
(
write_bin_log
(
thd
,
FALSE
,
thd
->
query
,
thd
->
query_length
),
FALSE
))
||
ERROR_INJECT
ED
_CRASH
(
1014
)
||
ERROR_INJECT_CRASH
(
1014
)
||
write_log_shadow_frm
(
lpt
,
TRUE
)
||
ERROR_INJECT
ED
_CRASH
(
1015
)
||
ERROR_INJECT_CRASH
(
1015
)
||
mysql_write_frm
(
lpt
,
WFRM_INSTALL_SHADOW
)
||
ERROR_INJECT
ED
_CRASH
(
1016
)
||
ERROR_INJECT_CRASH
(
1016
)
||
(
close_open_tables_and_downgrade
(
lpt
),
FALSE
)
||
write_log_completed
(
lpt
)
||
ERROR_INJECT
ED
_CRASH
(
1017
))
ERROR_INJECT_CRASH
(
1017
))
{
fast_alter_partition_error_handler
(
lpt
);
DBUG_RETURN
(
TRUE
);
...
...
sql/sql_table.cc
View file @
da5713e4
...
...
@@ -307,9 +307,9 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
/*
Build shadow frm file name
*/
build_table_filename
(
shadow_path
,
sizeof
(
path
),
lpt
->
db
,
build_table_filename
(
shadow_path
,
sizeof
(
shadow_
path
),
lpt
->
db
,
lpt
->
table_name
,
"#"
);
strxmov
(
shadow_frm_name
,
path
,
reg_ext
,
NullS
);
strxmov
(
shadow_frm_name
,
shadow_
path
,
reg_ext
,
NullS
);
if
(
flags
&
WFRM_WRITE_SHADOW
)
{
if
(
mysql_copy_create_list
(
lpt
->
create_list
,
...
...
@@ -324,7 +324,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
lpt
->
table
->
file
,
&
lpt
->
key_info_buffer
,
&
lpt
->
key_count
,
/*select_field_count*/
0
))
)
/*select_field_count*/
0
))
{
DBUG_RETURN
(
TRUE
);
}
...
...
sql/table.cc
View file @
da5713e4
...
...
@@ -638,6 +638,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
#endif
next_chunk
+=
5
+
partition_info_len
;
}
#if 0
if (share->mysql_version == 50106)
{
/*
...
...
@@ -647,6 +648,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
*/
next_chunk+= 4;
}
#endif
keyinfo
=
share
->
key_info
;
for
(
i
=
0
;
i
<
keys
;
i
++
,
keyinfo
++
)
{
...
...
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