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
12647d73
Commit
12647d73
authored
Feb 11, 2006
by
pappa@c-9a08e253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile fixes
parent
10c5b8f3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
22 deletions
+24
-22
sql/ha_partition.cc
sql/ha_partition.cc
+8
-7
sql/handler.h
sql/handler.h
+2
-2
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_partition.cc
sql/sql_partition.cc
+9
-9
sql/sql_table.cc
sql/sql_table.cc
+4
-4
No files found.
sql/ha_partition.cc
View file @
12647d73
...
@@ -101,7 +101,9 @@ handlerton partition_hton = {
...
@@ -101,7 +101,9 @@ handlerton partition_hton = {
partition_flags
,
/* Partition flags */
partition_flags
,
/* Partition flags */
alter_table_flags
,
/* Partition flags */
alter_table_flags
,
/* Partition flags */
NULL
,
/* Alter Tablespace */
NULL
,
/* Alter Tablespace */
HTON_NOT_USER_SELECTABLE
|
HTON_HIDDEN
HTON_NOT_USER_SELECTABLE
|
HTON_HIDDEN
,
NULL
,
/* binlog function */
NULL
/* binlog query */
};
};
/*
/*
...
@@ -495,10 +497,9 @@ int ha_partition::create_handler_files(const char *path,
...
@@ -495,10 +497,9 @@ int ha_partition::create_handler_files(const char *path,
{
{
char
name
[
FN_REFLEN
];
char
name
[
FN_REFLEN
];
char
old_name
[
FN_REFLEN
];
char
old_name
[
FN_REFLEN
];
char
*
par_str
=
".par"
;
strxmov
(
name
,
path
,
par_str
,
NullS
);
strxmov
(
name
,
path
,
ha_par_ext
,
NullS
);
strxmov
(
old_name
,
old_path
,
par_str
,
NullS
);
strxmov
(
old_name
,
old_path
,
ha_par_ext
,
NullS
);
if
(
my_delete
(
name
,
MYF
(
MY_WME
))
||
if
(
my_delete
(
name
,
MYF
(
MY_WME
))
||
my_rename
(
old_name
,
name
,
MYF
(
MY_WME
)))
my_rename
(
old_name
,
name
,
MYF
(
MY_WME
)))
{
{
...
@@ -763,7 +764,7 @@ int ha_partition::rename_partitions(const char *path)
...
@@ -763,7 +764,7 @@ int ha_partition::rename_partitions(const char *path)
if
(
file
->
delete_table
((
const
char
*
)
norm_name_buff
)
||
if
(
file
->
delete_table
((
const
char
*
)
norm_name_buff
)
||
inactivate_table_log_entry
(
sub_elem
->
log_entry
->
entry_pos
))
inactivate_table_log_entry
(
sub_elem
->
log_entry
->
entry_pos
))
error
=
1
;
error
=
1
;
VOID
(
sync
h
_table_log
());
VOID
(
sync_table_log
());
}
}
file
=
m_new_file
[
part
];
file
=
m_new_file
[
part
];
create_subpartition_name
(
part_name_buff
,
path
,
create_subpartition_name
(
part_name_buff
,
path
,
...
@@ -792,7 +793,7 @@ int ha_partition::rename_partitions(const char *path)
...
@@ -792,7 +793,7 @@ int ha_partition::rename_partitions(const char *path)
if
(
file
->
delete_table
((
const
char
*
)
norm_name_buff
)
||
if
(
file
->
delete_table
((
const
char
*
)
norm_name_buff
)
||
inactivate_table_log_entry
(
part_elem
->
log_entry
->
entry_pos
))
inactivate_table_log_entry
(
part_elem
->
log_entry
->
entry_pos
))
error
=
1
;
error
=
1
;
VOID
(
sync
h
_table_log
());
VOID
(
sync_table_log
());
}
}
file
=
m_new_file
[
i
];
file
=
m_new_file
[
i
];
create_partition_name
(
part_name_buff
,
path
,
create_partition_name
(
part_name_buff
,
path
,
...
@@ -809,7 +810,7 @@ int ha_partition::rename_partitions(const char *path)
...
@@ -809,7 +810,7 @@ int ha_partition::rename_partitions(const char *path)
}
}
}
}
}
while
(
++
i
<
no_parts
);
}
while
(
++
i
<
no_parts
);
VOID
(
sync
h
_table_log
());
VOID
(
sync_table_log
());
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
...
sql/handler.h
View file @
12647d73
...
@@ -658,6 +658,7 @@ typedef struct {
...
@@ -658,6 +658,7 @@ typedef struct {
#define UNDEF_NODEGROUP 65535
#define UNDEF_NODEGROUP 65535
class
Item
;
class
Item
;
struct
st_table_log_memory_entry
;
class
partition_element
:
public
Sql_alloc
{
class
partition_element
:
public
Sql_alloc
{
public:
public:
...
@@ -667,7 +668,7 @@ class partition_element :public Sql_alloc {
...
@@ -667,7 +668,7 @@ class partition_element :public Sql_alloc {
ulonglong
part_min_rows
;
ulonglong
part_min_rows
;
char
*
partition_name
;
char
*
partition_name
;
char
*
tablespace_name
;
char
*
tablespace_name
;
TABLE_LOG_MEMORY_ENTRY
*
log_entry
;
st_table_log_memory_entry
*
log_entry
;
longlong
range_value
;
longlong
range_value
;
char
*
part_comment
;
char
*
part_comment
;
char
*
data_file_name
;
char
*
data_file_name
;
...
@@ -801,7 +802,6 @@ typedef int (*get_partitions_in_range_iter)(partition_info *part_info,
...
@@ -801,7 +802,6 @@ typedef int (*get_partitions_in_range_iter)(partition_info *part_info,
PARTITION_ITERATOR
*
part_iter
);
PARTITION_ITERATOR
*
part_iter
);
struct
st_table_log_memory_entry
;
class
partition_info
:
public
Sql_alloc
class
partition_info
:
public
Sql_alloc
{
{
...
...
sql/mysql_priv.h
View file @
12647d73
...
@@ -1206,6 +1206,7 @@ bool write_execute_table_log_entry(uint first_entry,
...
@@ -1206,6 +1206,7 @@ bool write_execute_table_log_entry(uint first_entry,
TABLE_LOG_MEMORY_ENTRY
**
active_entry
);
TABLE_LOG_MEMORY_ENTRY
**
active_entry
);
bool
inactivate_table_log_entry
(
uint
entry_no
);
bool
inactivate_table_log_entry
(
uint
entry_no
);
void
release_table_log_memory_entry
(
TABLE_LOG_MEMORY_ENTRY
*
log_entry
);
void
release_table_log_memory_entry
(
TABLE_LOG_MEMORY_ENTRY
*
log_entry
);
bool
sync_table_log
();
void
release_table_log
();
void
release_table_log
();
void
execute_table_log_recovery
();
void
execute_table_log_recovery
();
bool
execute_table_log_entry
(
uint
first_entry
);
bool
execute_table_log_entry
(
uint
first_entry
);
...
...
sql/sql_partition.cc
View file @
12647d73
...
@@ -5215,12 +5215,12 @@ write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
...
@@ -5215,12 +5215,12 @@ write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
part_elem
->
partition_name
,
part_elem
->
partition_name
,
sub_elem
->
partition_name
,
sub_elem
->
partition_name
,
NORMAL_PART_NAME
);
NORMAL_PART_NAME
);
table_log_entry
.
name
=
norm_path
;
table_log_entry
.
name
=
norm
al
_path
;
table_log_entry
.
from_name
=
tmp_path
;
table_log_entry
.
from_name
=
tmp_path
;
if
(
part_elem
->
part_state
==
PART_IS_CHANGED
)
if
(
part_elem
->
part_state
==
PART_IS_CHANGED
)
table_log_entry
->
action_type
=
TLOG_REPLACE_ACTION_CODE
;
table_log_entry
.
action_type
=
TLOG_REPLACE_ACTION_CODE
;
else
else
table_log_entry
->
action_type
=
TLOG_RENAME_ACTION_CODE
;
table_log_entry
.
action_type
=
TLOG_RENAME_ACTION_CODE
;
if
(
write_table_log_entry
(
&
table_log_entry
,
&
log_entry
))
if
(
write_table_log_entry
(
&
table_log_entry
,
&
log_entry
))
{
{
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
...
@@ -5244,19 +5244,19 @@ write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
...
@@ -5244,19 +5244,19 @@ write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
table_log_entry
.
name
=
normal_path
;
table_log_entry
.
name
=
normal_path
;
table_log_entry
.
from_name
=
tmp_path
;
table_log_entry
.
from_name
=
tmp_path
;
if
(
part_elem
->
part_state
==
PART_IS_CHANGED
)
if
(
part_elem
->
part_state
==
PART_IS_CHANGED
)
table_log_entry
->
action_type
=
TLOG_REPLACE_ACTION_CODE
;
table_log_entry
.
action_type
=
TLOG_REPLACE_ACTION_CODE
;
else
else
table_log_entry
->
action_type
=
TLOG_RENAME_ACTION_CODE
;
table_log_entry
.
action_type
=
TLOG_RENAME_ACTION_CODE
;
if
(
write_table_log_entry
(
&
table_log_entry
,
&
log_entry
))
if
(
write_table_log_entry
(
&
table_log_entry
,
&
log_entry
))
{
{
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
*
next_entry
=
log_entry
->
entry_pos
;
*
next_entry
=
log_entry
->
entry_pos
;
part_elem
->
table_
log_entry
=
log_entry
;
part_elem
->
log_entry
=
log_entry
;
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
}
}
}
}
}
while
(
++
i
<
no_elements
)
}
while
(
++
i
<
no_elements
)
;
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
}
}
...
@@ -5332,7 +5332,7 @@ write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
...
@@ -5332,7 +5332,7 @@ write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
}
}
*
next_entry
=
log_entry
->
entry_pos
;
*
next_entry
=
log_entry
->
entry_pos
;
if
(
temp_list
)
if
(
temp_list
)
sub_elem
->
table_
log_entry
=
log_entry
;
sub_elem
->
log_entry
=
log_entry
;
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
}
while
(
++
j
<
no_subparts
);
}
while
(
++
j
<
no_subparts
);
}
}
...
@@ -5351,7 +5351,7 @@ write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
...
@@ -5351,7 +5351,7 @@ write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
}
}
*
next_entry
=
log_entry
->
entry_pos
;
*
next_entry
=
log_entry
->
entry_pos
;
if
(
temp_list
)
if
(
temp_list
)
part_elem
->
table_
log_entry
=
log_entry
;
part_elem
->
log_entry
=
log_entry
;
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
}
}
}
}
...
...
sql/sql_table.cc
View file @
12647d73
...
@@ -293,6 +293,7 @@ pthread_mutex_t LOCK_gtl;
...
@@ -293,6 +293,7 @@ pthread_mutex_t LOCK_gtl;
#define TLOG_ACTION_TYPE_POS 1
#define TLOG_ACTION_TYPE_POS 1
#define TLOG_PHASE_POS 2
#define TLOG_PHASE_POS 2
#define TLOG_NEXT_ENTRY_POS 4
#define TLOG_NEXT_ENTRY_POS 4
#define TLOG_NAME_POS 8
#define TLOG_NO_ENTRY_POS 0
#define TLOG_NO_ENTRY_POS 0
#define TLOG_NAME_LEN_POS 4
#define TLOG_NAME_LEN_POS 4
...
@@ -762,18 +763,18 @@ bool
...
@@ -762,18 +763,18 @@ bool
inactivate_table_log_entry
(
uint
entry_no
)
inactivate_table_log_entry
(
uint
entry_no
)
{
{
bool
error
=
TRUE
;
bool
error
=
TRUE
;
c
onst
char
*
file_entry
=
(
const
char
*
)
global_table_log
.
file_entry
c
har
*
file_entry
=
(
char
*
)
global_table_log
.
file_entry
;
DBUG_ENTER
(
"inactivate_table_log_entry"
);
DBUG_ENTER
(
"inactivate_table_log_entry"
);
if
(
!
read_table_log_file_entry
(
entry_no
))
if
(
!
read_table_log_file_entry
(
entry_no
))
{
{
if
(
file_entry
[
TLOG_ENTRY_POS
]
==
TLOG_LOG_ENTRY_CODE
)
if
(
file_entry
[
TLOG_ENTRY_
TYPE_
POS
]
==
TLOG_LOG_ENTRY_CODE
)
{
{
if
(
file_entry
[
TLOG_ACTION_TYPE_POS
]
==
TLOG_DELETE_ACTION_CODE
||
if
(
file_entry
[
TLOG_ACTION_TYPE_POS
]
==
TLOG_DELETE_ACTION_CODE
||
file_entry
[
TLOG_ACTION_TYPE_POS
]
==
TLOG_RENAME_ACTION_CODE
||
file_entry
[
TLOG_ACTION_TYPE_POS
]
==
TLOG_RENAME_ACTION_CODE
||
(
file_entry
[
TLOG_ACTION_TYPE_POS
]
==
TLOG_REPLACE_ACTION_CODE
&&
(
file_entry
[
TLOG_ACTION_TYPE_POS
]
==
TLOG_REPLACE_ACTION_CODE
&&
file_entry
[
TLOG_PHASE_POS
]
==
1
))
file_entry
[
TLOG_PHASE_POS
]
==
1
))
file_entry
[
TLOG_ENTRY_TYPE_POS
]
=
TLOG_IGNORE_LOG_ENTRY_
POS
;
file_entry
[
TLOG_ENTRY_TYPE_POS
]
=
TLOG_IGNORE_LOG_ENTRY_
CODE
;
else
if
(
file_entry
[
TLOG_ACTION_TYPE_POS
]
==
TLOG_REPLACE_ACTION_CODE
)
else
if
(
file_entry
[
TLOG_ACTION_TYPE_POS
]
==
TLOG_REPLACE_ACTION_CODE
)
{
{
DBUG_ASSERT
(
file_entry
[
TLOG_PHASE_POS
]
==
0
);
DBUG_ASSERT
(
file_entry
[
TLOG_PHASE_POS
]
==
0
);
...
@@ -800,7 +801,6 @@ inactivate_table_log_entry(uint entry_no)
...
@@ -800,7 +801,6 @@ inactivate_table_log_entry(uint entry_no)
FALSE Success
FALSE Success
*/
*/
static
bool
bool
sync_table_log
()
sync_table_log
()
{
{
...
...
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