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
f7b98c25
Commit
f7b98c25
authored
Apr 20, 2011
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge from 5.1
parents
1d75aeb9
b3d86f12
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
349 additions
and
151 deletions
+349
-151
.bzrignore
.bzrignore
+9
-0
sql/ha_partition.cc
sql/ha_partition.cc
+283
-121
sql/ha_partition.h
sql/ha_partition.h
+27
-8
sql/handler.cc
sql/handler.cc
+17
-10
sql/handler.h
sql/handler.h
+1
-1
sql/opt_range.cc
sql/opt_range.cc
+1
-1
storage/heap/ha_heap.cc
storage/heap/ha_heap.cc
+2
-2
storage/heap/ha_heap.h
storage/heap/ha_heap.h
+1
-1
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+3
-2
storage/myisam/ha_myisam.h
storage/myisam/ha_myisam.h
+1
-1
storage/myisammrg/ha_myisammrg.cc
storage/myisammrg/ha_myisammrg.cc
+3
-3
storage/myisammrg/ha_myisammrg.h
storage/myisammrg/ha_myisammrg.h
+1
-1
No files found.
.bzrignore
View file @
f7b98c25
...
@@ -43,6 +43,10 @@
...
@@ -43,6 +43,10 @@
*.vcxproj
*.vcxproj
*.vcxproj.filters
*.vcxproj.filters
*/*.dir/*
*/*.dir/*
*.dir
Debug
MySql.sdf
Win32
*/*_pure_*warnings
*/*_pure_*warnings
*/.deps
*/.deps
*/.libs/*
*/.libs/*
...
@@ -615,6 +619,7 @@ include/mysql_h.ic
...
@@ -615,6 +619,7 @@ include/mysql_h.ic
include/mysql_version.h
include/mysql_version.h
include/mysqld_ername.h
include/mysqld_ername.h
include/mysqld_error.h
include/mysqld_error.h
include/mysqld_error.h.rule
include/openssl
include/openssl
include/probes_mysql_dtrace.h
include/probes_mysql_dtrace.h
include/readline
include/readline
...
@@ -1897,7 +1902,9 @@ scripts/mysql_find_rows
...
@@ -1897,7 +1902,9 @@ scripts/mysql_find_rows
scripts/mysql_fix_extensions
scripts/mysql_fix_extensions
scripts/mysql_fix_privilege_tables
scripts/mysql_fix_privilege_tables
scripts/mysql_fix_privilege_tables.sql
scripts/mysql_fix_privilege_tables.sql
scripts/mysql_fix_privilege_tables.sql.rule
scripts/mysql_fix_privilege_tables_sql.c
scripts/mysql_fix_privilege_tables_sql.c
scripts/mysql_fix_privilege_tables_sql.c.rule
scripts/mysql_install_db
scripts/mysql_install_db
scripts/mysql_secure_installation
scripts/mysql_secure_installation
scripts/mysql_setpermission
scripts/mysql_setpermission
...
@@ -2137,6 +2144,7 @@ sql/handlerton.cc
...
@@ -2137,6 +2144,7 @@ sql/handlerton.cc
sql/html
sql/html
sql/latex
sql/latex
sql/lex_hash.h
sql/lex_hash.h
sql/lex_hash.h.rule
sql/link_sources
sql/link_sources
sql/max/*
sql/max/*
sql/message.h
sql/message.h
...
@@ -2168,6 +2176,7 @@ sql/sql_builtin.cc
...
@@ -2168,6 +2176,7 @@ sql/sql_builtin.cc
sql/sql_select.cc.orig
sql/sql_select.cc.orig
sql/sql_yacc.cc
sql/sql_yacc.cc
sql/sql_yacc.h
sql/sql_yacc.h
sql/sql_yacc.h.rule
sql/sql_yacc.output
sql/sql_yacc.output
sql/sql_yacc.yy.orig
sql/sql_yacc.yy.orig
sql/test_time
sql/test_time
...
...
sql/ha_partition.cc
View file @
f7b98c25
This diff is collapsed.
Click to expand it.
sql/ha_partition.h
View file @
f7b98c25
...
@@ -37,6 +37,16 @@ enum partition_keywords
...
@@ -37,6 +37,16 @@ enum partition_keywords
HA_DUPLICATE_POS | \
HA_DUPLICATE_POS | \
HA_CAN_SQL_HANDLER | \
HA_CAN_SQL_HANDLER | \
HA_CAN_INSERT_DELAYED)
HA_CAN_INSERT_DELAYED)
/* First 4 bytes in the .par file is the number of 32-bit words in the file */
#define PAR_WORD_SIZE 4
/* offset to the .par file checksum */
#define PAR_CHECKSUM_OFFSET 4
/* offset to the total number of partitions */
#define PAR_NUM_PARTS_OFFSET 8
/* offset to the engines array */
#define PAR_ENGINES_OFFSET 12
class
ha_partition
:
public
handler
class
ha_partition
:
public
handler
{
{
private:
private:
...
@@ -53,7 +63,7 @@ private:
...
@@ -53,7 +63,7 @@ private:
/* Data for the partition handler */
/* Data for the partition handler */
int
m_mode
;
// Open mode
int
m_mode
;
// Open mode
uint
m_open_test_lock
;
// Open test_if_locked
uint
m_open_test_lock
;
// Open test_if_locked
char
*
m_file_buffer
;
//
Buffer with names
char
*
m_file_buffer
;
//
Content of the .par file
char
*
m_name_buffer_ptr
;
// Pointer to first partition name
char
*
m_name_buffer_ptr
;
// Pointer to first partition name
plugin_ref
*
m_engine_array
;
// Array of types of the handlers
plugin_ref
*
m_engine_array
;
// Array of types of the handlers
handler
**
m_file
;
// Array of references to handler inst.
handler
**
m_file
;
// Array of references to handler inst.
...
@@ -115,6 +125,13 @@ private:
...
@@ -115,6 +125,13 @@ private:
bool
m_is_sub_partitioned
;
// Is subpartitioned
bool
m_is_sub_partitioned
;
// Is subpartitioned
bool
m_ordered_scan_ongoing
;
bool
m_ordered_scan_ongoing
;
/*
If set, this object was created with ha_partition::clone and doesn't
"own" the m_part_info structure.
*/
ha_partition
*
m_is_clone_of
;
MEM_ROOT
*
m_clone_mem_root
;
/*
/*
We keep track if all underlying handlers are MyISAM since MyISAM has a
We keep track if all underlying handlers are MyISAM since MyISAM has a
great number of extra flags not needed by other handlers.
great number of extra flags not needed by other handlers.
...
@@ -148,11 +165,6 @@ private:
...
@@ -148,11 +165,6 @@ private:
*/
*/
THR_LOCK_DATA
lock
;
/* MySQL lock */
THR_LOCK_DATA
lock
;
/* MySQL lock */
/*
TRUE <=> this object was created with ha_partition::clone and doesn't
"own" the m_part_info structure.
*/
bool
is_clone
;
bool
auto_increment_lock
;
/**< lock reading/updating auto_inc */
bool
auto_increment_lock
;
/**< lock reading/updating auto_inc */
/**
/**
Flag to keep the auto_increment lock through out the statement.
Flag to keep the auto_increment lock through out the statement.
...
@@ -165,7 +177,7 @@ private:
...
@@ -165,7 +177,7 @@ private:
/** used for prediction of start_bulk_insert rows */
/** used for prediction of start_bulk_insert rows */
enum_monotonicity_info
m_part_func_monotonicity_info
;
enum_monotonicity_info
m_part_func_monotonicity_info
;
public:
public:
handler
*
clone
(
MEM_ROOT
*
mem_root
);
handler
*
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
);
virtual
void
set_part_info
(
partition_info
*
part_info
)
virtual
void
set_part_info
(
partition_info
*
part_info
)
{
{
m_part_info
=
part_info
;
m_part_info
=
part_info
;
...
@@ -184,6 +196,10 @@ public:
...
@@ -184,6 +196,10 @@ public:
*/
*/
ha_partition
(
handlerton
*
hton
,
TABLE_SHARE
*
table
);
ha_partition
(
handlerton
*
hton
,
TABLE_SHARE
*
table
);
ha_partition
(
handlerton
*
hton
,
partition_info
*
part_info
);
ha_partition
(
handlerton
*
hton
,
partition_info
*
part_info
);
ha_partition
(
handlerton
*
hton
,
TABLE_SHARE
*
share
,
partition_info
*
part_info_arg
,
ha_partition
*
clone_arg
,
MEM_ROOT
*
clone_mem_root_arg
);
~
ha_partition
();
~
ha_partition
();
/*
/*
A partition handler has no characteristics in itself. It only inherits
A partition handler has no characteristics in itself. It only inherits
...
@@ -254,7 +270,10 @@ private:
...
@@ -254,7 +270,10 @@ private:
And one method to read it in.
And one method to read it in.
*/
*/
bool
create_handler_file
(
const
char
*
name
);
bool
create_handler_file
(
const
char
*
name
);
bool
get_from_handler_file
(
const
char
*
name
,
MEM_ROOT
*
mem_root
);
bool
setup_engine_array
(
MEM_ROOT
*
mem_root
);
bool
read_par_file
(
const
char
*
name
);
bool
get_from_handler_file
(
const
char
*
name
,
MEM_ROOT
*
mem_root
,
bool
is_clone
);
bool
new_handlers_from_part_info
(
MEM_ROOT
*
mem_root
);
bool
new_handlers_from_part_info
(
MEM_ROOT
*
mem_root
);
bool
create_handlers
(
MEM_ROOT
*
mem_root
);
bool
create_handlers
(
MEM_ROOT
*
mem_root
);
void
clear_handler_file
();
void
clear_handler_file
();
...
...
sql/handler.cc
View file @
f7b98c25
...
@@ -2076,22 +2076,29 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
...
@@ -2076,22 +2076,29 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
/****************************************************************************
/****************************************************************************
** General handler functions
** General handler functions
****************************************************************************/
****************************************************************************/
handler
*
handler
::
clone
(
MEM_ROOT
*
mem_root
)
handler
*
handler
::
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
)
{
{
handler
*
new_handler
=
get_new_handler
(
table
->
s
,
mem_root
,
table
->
s
->
db_type
()
);
handler
*
new_handler
=
get_new_handler
(
table
->
s
,
mem_root
,
ht
);
/*
/*
Allocate handler->ref here because otherwise ha_open will allocate it
Allocate handler->ref here because otherwise ha_open will allocate it
on this->table->mem_root and we will not be able to reclaim that memory
on this->table->mem_root and we will not be able to reclaim that memory
when the clone handler object is destroyed.
when the clone handler object is destroyed.
*/
*/
if
(
!
(
new_handler
->
ref
=
(
uchar
*
)
alloc_root
(
mem_root
,
ALIGN_SIZE
(
ref_length
)
*
2
)))
if
(
new_handler
&&
return
NULL
;
!
(
new_handler
->
ref
=
(
uchar
*
)
alloc_root
(
mem_root
,
if
(
new_handler
&&
!
new_handler
->
ha_open
(
table
,
ALIGN_SIZE
(
ref_length
)
*
2
)))
table
->
s
->
normalized_path
.
str
,
new_handler
=
NULL
;
/*
TODO: Implement a more efficient way to have more than one index open for
the same table instance. The ha_open call is not cachable for clone.
*/
if
(
new_handler
&&
new_handler
->
ha_open
(
table
,
name
,
table
->
db_stat
,
table
->
db_stat
,
HA_OPEN_IGNORE_IF_LOCKED
))
HA_OPEN_IGNORE_IF_LOCKED
))
new_handler
=
NULL
;
return
new_handler
;
return
new_handler
;
return
NULL
;
}
}
...
...
sql/handler.h
View file @
f7b98c25
...
@@ -1262,7 +1262,7 @@ public:
...
@@ -1262,7 +1262,7 @@ public:
DBUG_ASSERT
(
locked
==
FALSE
);
DBUG_ASSERT
(
locked
==
FALSE
);
DBUG_ASSERT
(
inited
==
NONE
);
DBUG_ASSERT
(
inited
==
NONE
);
}
}
virtual
handler
*
clone
(
MEM_ROOT
*
mem_root
);
virtual
handler
*
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
);
/** This is called after create to allow us to set up cached variables */
/** This is called after create to allow us to set up cached variables */
void
init
()
void
init
()
{
{
...
...
sql/opt_range.cc
View file @
f7b98c25
...
@@ -1368,7 +1368,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
...
@@ -1368,7 +1368,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
}
}
thd
=
head
->
in_use
;
thd
=
head
->
in_use
;
if
(
!
(
file
=
head
->
file
->
clone
(
thd
->
mem_root
)))
if
(
!
(
file
=
head
->
file
->
clone
(
head
->
s
->
normalized_path
.
str
,
thd
->
mem_root
)))
{
{
/*
/*
Manually set the error flag. Note: there seems to be quite a few
Manually set the error flag. Note: there seems to be quite a few
...
...
storage/heap/ha_heap.cc
View file @
f7b98c25
...
@@ -157,11 +157,11 @@ int ha_heap::close(void)
...
@@ -157,11 +157,11 @@ int ha_heap::close(void)
DESCRIPTION
DESCRIPTION
Do same as default implementation but use file->s->name instead of
Do same as default implementation but use file->s->name instead of
table->s->path. This is needed by Windows where the clone() call sees
table->s->path. This is needed by Windows where the clone() call sees
'/'-delimited path in table->s->path, while ha_
p
eap::open() was called
'/'-delimited path in table->s->path, while ha_
h
eap::open() was called
with '\'-delimited path.
with '\'-delimited path.
*/
*/
handler
*
ha_heap
::
clone
(
MEM_ROOT
*
mem_root
)
handler
*
ha_heap
::
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
)
{
{
handler
*
new_handler
=
get_new_handler
(
table
->
s
,
mem_root
,
table
->
s
->
db_type
());
handler
*
new_handler
=
get_new_handler
(
table
->
s
,
mem_root
,
table
->
s
->
db_type
());
if
(
new_handler
&&
!
new_handler
->
ha_open
(
table
,
file
->
s
->
name
,
table
->
db_stat
,
if
(
new_handler
&&
!
new_handler
->
ha_open
(
table
,
file
->
s
->
name
,
table
->
db_stat
,
...
...
storage/heap/ha_heap.h
View file @
f7b98c25
...
@@ -35,7 +35,7 @@ class ha_heap: public handler
...
@@ -35,7 +35,7 @@ class ha_heap: public handler
public:
public:
ha_heap
(
handlerton
*
hton
,
TABLE_SHARE
*
table
);
ha_heap
(
handlerton
*
hton
,
TABLE_SHARE
*
table
);
~
ha_heap
()
{}
~
ha_heap
()
{}
handler
*
clone
(
MEM_ROOT
*
mem_root
);
handler
*
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
);
const
char
*
table_type
()
const
const
char
*
table_type
()
const
{
{
return
(
table
->
in_use
->
variables
.
sql_mode
&
MODE_MYSQL323
)
?
return
(
table
->
in_use
->
variables
.
sql_mode
&
MODE_MYSQL323
)
?
...
...
storage/myisam/ha_myisam.cc
View file @
f7b98c25
...
@@ -643,9 +643,10 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
...
@@ -643,9 +643,10 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
can_enable_indexes
(
1
)
can_enable_indexes
(
1
)
{}
{}
handler
*
ha_myisam
::
clone
(
MEM_ROOT
*
mem_root
)
handler
*
ha_myisam
::
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
)
{
{
ha_myisam
*
new_handler
=
static_cast
<
ha_myisam
*>
(
handler
::
clone
(
mem_root
));
ha_myisam
*
new_handler
=
static_cast
<
ha_myisam
*>
(
handler
::
clone
(
name
,
mem_root
));
if
(
new_handler
)
if
(
new_handler
)
new_handler
->
file
->
state
=
file
->
state
;
new_handler
->
file
->
state
=
file
->
state
;
return
new_handler
;
return
new_handler
;
...
...
storage/myisam/ha_myisam.h
View file @
f7b98c25
...
@@ -50,7 +50,7 @@ class ha_myisam: public handler
...
@@ -50,7 +50,7 @@ class ha_myisam: public handler
public:
public:
ha_myisam
(
handlerton
*
hton
,
TABLE_SHARE
*
table_arg
);
ha_myisam
(
handlerton
*
hton
,
TABLE_SHARE
*
table_arg
);
~
ha_myisam
()
{}
~
ha_myisam
()
{}
handler
*
clone
(
MEM_ROOT
*
mem_root
);
handler
*
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
);
const
char
*
table_type
()
const
{
return
"MyISAM"
;
}
const
char
*
table_type
()
const
{
return
"MyISAM"
;
}
const
char
*
index_type
(
uint
key_number
);
const
char
*
index_type
(
uint
key_number
);
const
char
**
bas_ext
()
const
;
const
char
**
bas_ext
()
const
;
...
...
storage/myisammrg/ha_myisammrg.cc
View file @
f7b98c25
...
@@ -681,7 +681,7 @@ CPP_UNNAMED_NS_END
...
@@ -681,7 +681,7 @@ CPP_UNNAMED_NS_END
@return A cloned handler instance.
@return A cloned handler instance.
*/
*/
handler
*
ha_myisammrg
::
clone
(
MEM_ROOT
*
mem_root
)
handler
*
ha_myisammrg
::
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
)
{
{
MYRG_TABLE
*
u_table
,
*
newu_table
;
MYRG_TABLE
*
u_table
,
*
newu_table
;
ha_myisammrg
*
new_handler
=
ha_myisammrg
*
new_handler
=
...
@@ -702,7 +702,7 @@ handler *ha_myisammrg::clone(MEM_ROOT *mem_root)
...
@@ -702,7 +702,7 @@ handler *ha_myisammrg::clone(MEM_ROOT *mem_root)
return
NULL
;
return
NULL
;
}
}
if
(
new_handler
->
ha_open
(
table
,
table
->
s
->
normalized_path
.
str
,
table
->
db_stat
,
if
(
new_handler
->
ha_open
(
table
,
name
,
table
->
db_stat
,
HA_OPEN_IGNORE_IF_LOCKED
))
HA_OPEN_IGNORE_IF_LOCKED
))
{
{
delete
new_handler
;
delete
new_handler
;
...
...
storage/myisammrg/ha_myisammrg.h
View file @
f7b98c25
...
@@ -110,7 +110,7 @@ public:
...
@@ -110,7 +110,7 @@ public:
int
add_children_list
(
void
);
int
add_children_list
(
void
);
int
attach_children
(
void
);
int
attach_children
(
void
);
int
detach_children
(
void
);
int
detach_children
(
void
);
virtual
handler
*
clone
(
MEM_ROOT
*
mem_root
);
virtual
handler
*
clone
(
const
char
*
name
,
MEM_ROOT
*
mem_root
);
int
close
(
void
);
int
close
(
void
);
int
write_row
(
uchar
*
buf
);
int
write_row
(
uchar
*
buf
);
int
update_row
(
const
uchar
*
old_data
,
uchar
*
new_data
);
int
update_row
(
const
uchar
*
old_data
,
uchar
*
new_data
);
...
...
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