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
09c88914
Commit
09c88914
authored
Sep 20, 2005
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-push
parents
75cc4ef2
6b32d44d
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
226 additions
and
107 deletions
+226
-107
mysql-test/r/ps_1general.result
mysql-test/r/ps_1general.result
+2
-7
mysql-test/r/variables.result
mysql-test/r/variables.result
+1
-1
sql/examples/ha_archive.cc
sql/examples/ha_archive.cc
+1
-1
sql/examples/ha_example.cc
sql/examples/ha_example.cc
+1
-1
sql/examples/ha_tina.cc
sql/examples/ha_tina.cc
+1
-1
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+1
-1
sql/ha_blackhole.cc
sql/ha_blackhole.cc
+1
-1
sql/ha_federated.cc
sql/ha_federated.cc
+1
-1
sql/ha_heap.cc
sql/ha_heap.cc
+1
-1
sql/ha_innodb.cc
sql/ha_innodb.cc
+1
-1
sql/ha_myisam.cc
sql/ha_myisam.cc
+1
-1
sql/ha_myisammrg.cc
sql/ha_myisammrg.cc
+2
-2
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+1
-1
sql/handler.cc
sql/handler.cc
+197
-80
sql/handler.h
sql/handler.h
+14
-7
No files found.
mysql-test/r/ps_1general.result
View file @
09c88914
...
@@ -323,17 +323,12 @@ execute stmt4;
...
@@ -323,17 +323,12 @@ execute stmt4;
Engine Support Comment
Engine Support Comment
MyISAM YES/NO Default engine as of MySQL 3.23 with great performance
MyISAM YES/NO Default engine as of MySQL 3.23 with great performance
MEMORY YES/NO Hash based, stored in memory, useful for temporary tables
MEMORY YES/NO Hash based, stored in memory, useful for temporary tables
HEAP YES/NO Alias for MEMORY
MRG_MYISAM YES/NO Collection of identical MyISAM tables
MERGE YES/NO Collection of identical MyISAM tables
MRG_MYISAM YES/NO Alias for MERGE
ISAM YES/NO Obsolete storage engine, now replaced by MyISAM
ISAM YES/NO Obsolete storage engine, now replaced by MyISAM
MRG_ISAM YES/NO Obsolete storage engine, now replaced by MERGE
MRG_ISAM YES/NO Obsolete storage engine, now replaced by MERGE
InnoDB YES/NO Supports transactions, row-level locking, and foreign keys
InnoDB YES/NO Supports transactions, row-level locking, and foreign keys
INNOBASE YES/NO Alias for INNODB
BERKELEYDB YES/NO Supports transactions and page-level locking
BDB YES/NO Supports transactions and page-level locking
BERKELEYDB YES/NO Alias for BDB
NDBCLUSTER YES/NO Clustered, fault-tolerant, memory-based tables
NDBCLUSTER YES/NO Clustered, fault-tolerant, memory-based tables
NDB YES/NO Alias for NDBCLUSTER
EXAMPLE YES/NO Example storage engine
EXAMPLE YES/NO Example storage engine
ARCHIVE YES/NO Archive storage engine
ARCHIVE YES/NO Archive storage engine
CSV YES/NO CSV storage engine
CSV YES/NO CSV storage engine
...
...
mysql-test/r/variables.result
View file @
09c88914
...
@@ -147,7 +147,7 @@ Variable_name Value
...
@@ -147,7 +147,7 @@ Variable_name Value
storage_engine MEMORY
storage_engine MEMORY
show global variables like 'storage_engine';
show global variables like 'storage_engine';
Variable_name Value
Variable_name Value
storage_engine M
ERGE
storage_engine M
RG_MYISAM
set GLOBAL query_cache_size=100000;
set GLOBAL query_cache_size=100000;
set GLOBAL myisam_max_sort_file_size=2000000;
set GLOBAL myisam_max_sort_file_size=2000000;
show global variables like 'myisam_max_sort_file_size';
show global variables like 'myisam_max_sort_file_size';
...
...
sql/examples/ha_archive.cc
View file @
09c88914
...
@@ -136,7 +136,7 @@ static HASH archive_open_tables;
...
@@ -136,7 +136,7 @@ static HASH archive_open_tables;
#define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption
#define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption
/* dummy handlerton - only to have something to return from archive_db_init */
/* dummy handlerton - only to have something to return from archive_db_init */
static
handlerton
archive_hton
=
{
handlerton
archive_hton
=
{
"archive"
,
"archive"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size. */
0
,
/* savepoint size. */
...
...
sql/examples/ha_example.cc
View file @
09c88914
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
#include "ha_example.h"
#include "ha_example.h"
static
handlerton
example_hton
=
{
handlerton
example_hton
=
{
"CSV"
,
"CSV"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size. */
0
,
/* savepoint size. */
...
...
sql/examples/ha_tina.cc
View file @
09c88914
...
@@ -54,7 +54,7 @@ pthread_mutex_t tina_mutex;
...
@@ -54,7 +54,7 @@ pthread_mutex_t tina_mutex;
static
HASH
tina_open_tables
;
static
HASH
tina_open_tables
;
static
int
tina_init
=
0
;
static
int
tina_init
=
0
;
static
handlerton
tina_hton
=
{
handlerton
tina_hton
=
{
"CSV"
,
"CSV"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size. */
0
,
/* savepoint size. */
...
...
sql/ha_berkeley.cc
View file @
09c88914
...
@@ -107,7 +107,7 @@ static int berkeley_close_connection(THD *thd);
...
@@ -107,7 +107,7 @@ static int berkeley_close_connection(THD *thd);
static
int
berkeley_commit
(
THD
*
thd
,
bool
all
);
static
int
berkeley_commit
(
THD
*
thd
,
bool
all
);
static
int
berkeley_rollback
(
THD
*
thd
,
bool
all
);
static
int
berkeley_rollback
(
THD
*
thd
,
bool
all
);
static
handlerton
berkeley_hton
=
{
handlerton
berkeley_hton
=
{
"BerkeleyDB"
,
"BerkeleyDB"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size */
0
,
/* savepoint size */
...
...
sql/ha_blackhole.cc
View file @
09c88914
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
/* Blackhole storage engine handlerton */
/* Blackhole storage engine handlerton */
static
handlerton
blackhole_hton
=
{
handlerton
blackhole_hton
=
{
"BLACKHOLE"
,
"BLACKHOLE"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size. */
0
,
/* savepoint size. */
...
...
sql/ha_federated.cc
View file @
09c88914
...
@@ -693,7 +693,7 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table,
...
@@ -693,7 +693,7 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table,
/* Federated storage engine handlerton */
/* Federated storage engine handlerton */
static
handlerton
federated_hton
=
{
handlerton
federated_hton
=
{
"FEDERATED"
,
"FEDERATED"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size. */
0
,
/* savepoint size. */
...
...
sql/ha_heap.cc
View file @
09c88914
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include <myisampack.h>
#include <myisampack.h>
#include "ha_heap.h"
#include "ha_heap.h"
static
handlerton
heap_hton
=
{
handlerton
heap_hton
=
{
"MEMORY"
,
"MEMORY"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size. */
0
,
/* savepoint size. */
...
...
sql/ha_innodb.cc
View file @
09c88914
...
@@ -206,7 +206,7 @@ static int innobase_rollback_to_savepoint(THD* thd, void *savepoint);
...
@@ -206,7 +206,7 @@ static int innobase_rollback_to_savepoint(THD* thd, void *savepoint);
static
int
innobase_savepoint
(
THD
*
thd
,
void
*
savepoint
);
static
int
innobase_savepoint
(
THD
*
thd
,
void
*
savepoint
);
static
int
innobase_release_savepoint
(
THD
*
thd
,
void
*
savepoint
);
static
int
innobase_release_savepoint
(
THD
*
thd
,
void
*
savepoint
);
static
handlerton
innobase_hton
=
{
handlerton
innobase_hton
=
{
"InnoDB"
,
"InnoDB"
,
0
,
/* slot */
0
,
/* slot */
sizeof
(
trx_named_savept_t
),
/* savepoint size. TODO: use it */
sizeof
(
trx_named_savept_t
),
/* savepoint size. TODO: use it */
...
...
sql/ha_myisam.cc
View file @
09c88914
...
@@ -46,7 +46,7 @@ TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
...
@@ -46,7 +46,7 @@ TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
/* MyISAM handlerton */
/* MyISAM handlerton */
static
handlerton
myisam_hton
=
{
handlerton
myisam_hton
=
{
"MyISAM"
,
"MyISAM"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size. */
0
,
/* savepoint size. */
...
...
sql/ha_myisammrg.cc
View file @
09c88914
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
/* MyISAM MERGE handlerton */
/* MyISAM MERGE handlerton */
static
handlerton
myisammrg_hton
=
{
handlerton
myisammrg_hton
=
{
"MRG_M
y
ISAM"
,
"MRG_M
Y
ISAM"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size. */
0
,
/* savepoint size. */
NULL
,
/* close_connection */
NULL
,
/* close_connection */
...
...
sql/ha_ndbcluster.cc
View file @
09c88914
...
@@ -49,7 +49,7 @@ static int ndbcluster_close_connection(THD *thd);
...
@@ -49,7 +49,7 @@ static int ndbcluster_close_connection(THD *thd);
static
int
ndbcluster_commit
(
THD
*
thd
,
bool
all
);
static
int
ndbcluster_commit
(
THD
*
thd
,
bool
all
);
static
int
ndbcluster_rollback
(
THD
*
thd
,
bool
all
);
static
int
ndbcluster_rollback
(
THD
*
thd
,
bool
all
);
static
handlerton
ndbcluster_hton
=
{
handlerton
ndbcluster_hton
=
{
"ndbcluster"
,
"ndbcluster"
,
0
,
/* slot */
0
,
/* slot */
0
,
/* savepoint size */
0
,
/* savepoint size */
...
...
sql/handler.cc
View file @
09c88914
...
@@ -27,31 +27,44 @@
...
@@ -27,31 +27,44 @@
#include "ha_myisammrg.h"
#include "ha_myisammrg.h"
#ifdef HAVE_BERKELEY_DB
#ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h"
#include "ha_berkeley.h"
extern
handlerton
berkeley_hton
;
#endif
#endif
#ifdef HAVE_BLACKHOLE_DB
#ifdef HAVE_BLACKHOLE_DB
#include "ha_blackhole.h"
#include "ha_blackhole.h"
extern
handlerton
blackhole_hton
;
#endif
#endif
#ifdef HAVE_EXAMPLE_DB
#ifdef HAVE_EXAMPLE_DB
#include "examples/ha_example.h"
#include "examples/ha_example.h"
extern
handlerton
example_hton
;
#endif
#endif
#ifdef HAVE_ARCHIVE_DB
#ifdef HAVE_ARCHIVE_DB
#include "examples/ha_archive.h"
#include "examples/ha_archive.h"
extern
handlerton
archive_hton
;
#endif
#endif
#ifdef HAVE_CSV_DB
#ifdef HAVE_CSV_DB
#include "examples/ha_tina.h"
#include "examples/ha_tina.h"
extern
handlerton
tina_hton
;
#endif
#endif
#ifdef HAVE_INNOBASE_DB
#ifdef HAVE_INNOBASE_DB
#include "ha_innodb.h"
#include "ha_innodb.h"
extern
handlerton
innobase_hton
;
#endif
#endif
#ifdef HAVE_NDBCLUSTER_DB
#ifdef HAVE_NDBCLUSTER_DB
#include "ha_ndbcluster.h"
#include "ha_ndbcluster.h"
extern
handlerton
ndbcluster_hton
;
#endif
#endif
#ifdef HAVE_FEDERATED_DB
#ifdef HAVE_FEDERATED_DB
#include "ha_federated.h"
#include "ha_federated.h"
extern
handlerton
federated_hton
;
#endif
#endif
#include <myisampack.h>
#include <myisampack.h>
#include <errno.h>
#include <errno.h>
extern
handlerton
myisam_hton
;
extern
handlerton
myisammrg_hton
;
extern
handlerton
heap_hton
;
/* static functions defined in this file */
/* static functions defined in this file */
static
SHOW_COMP_OPTION
have_yes
=
SHOW_OPTION_YES
;
static
SHOW_COMP_OPTION
have_yes
=
SHOW_OPTION_YES
;
...
@@ -66,46 +79,52 @@ ulong total_ha_2pc;
...
@@ -66,46 +79,52 @@ ulong total_ha_2pc;
/* size of savepoint storage area (see ha_init) */
/* size of savepoint storage area (see ha_init) */
ulong
savepoint_alloc_size
;
ulong
savepoint_alloc_size
;
/*
This structure will go away in the future.
*/
struct
show_table_type_st
sys_table_types
[]
=
struct
show_table_type_st
sys_table_types
[]
=
{
{
{
"MyISAM"
,
&
have_yes
,
{
"MyISAM"
,
&
have_yes
,
"Default engine as of MySQL 3.23 with great performance"
,
DB_TYPE_MYISAM
},
"Default engine as of MySQL 3.23 with great performance"
,
DB_TYPE_MYISAM
,
NULL
},
{
"MEMORY"
,
&
have_yes
,
{
"MEMORY"
,
&
have_yes
,
"Hash based, stored in memory, useful for temporary tables"
,
DB_TYPE_HEAP
},
"Hash based, stored in memory, useful for temporary tables"
,
DB_TYPE_HEAP
,
{
"HEAP"
,
&
have_yes
,
NULL
},
"Alias for MEMORY"
,
DB_TYPE_HEAP
},
{
"MRG_MYISAM"
,
&
have_yes
,
{
"MERGE"
,
&
have_yes
,
"Collection of identical MyISAM tables"
,
DB_TYPE_MRG_MYISAM
,
NULL
},
"Collection of identical MyISAM tables"
,
DB_TYPE_MRG_MYISAM
},
{
"MRG_MYISAM"
,
&
have_yes
,
"Alias for MERGE"
,
DB_TYPE_MRG_MYISAM
},
{
"ISAM"
,
&
have_isam
,
{
"ISAM"
,
&
have_isam
,
"Obsolete storage engine, now replaced by MyISAM"
,
DB_TYPE_ISAM
},
"Obsolete storage engine, now replaced by MyISAM"
,
DB_TYPE_ISAM
,
NULL
},
{
"MRG_ISAM"
,
&
have_isam
,
{
"MRG_ISAM"
,
&
have_isam
,
"Obsolete storage engine, now replaced by MERGE"
,
DB_TYPE_MRG_ISAM
},
"Obsolete storage engine, now replaced by MERGE"
,
DB_TYPE_MRG_ISAM
,
NULL
},
{
"InnoDB"
,
&
have_innodb
,
{
"InnoDB"
,
&
have_innodb
,
"Supports transactions, row-level locking, and foreign keys"
,
DB_TYPE_INNODB
},
"Supports transactions, row-level locking, and foreign keys"
,
DB_TYPE_INNODB
,
{
"INNOBASE"
,
&
have_innodb
,
NULL
},
"Alias for INNODB"
,
DB_TYPE_INNODB
},
{
"BERKELEYDB"
,
&
have_berkeley_db
,
{
"BDB"
,
&
have_berkeley_db
,
"Supports transactions and page-level locking"
,
DB_TYPE_BERKELEY_DB
,
NULL
},
"Supports transactions and page-level locking"
,
DB_TYPE_BERKELEY_DB
},
{
"BERKELEYDB"
,
&
have_berkeley_db
,
"Alias for BDB"
,
DB_TYPE_BERKELEY_DB
},
{
"NDBCLUSTER"
,
&
have_ndbcluster
,
{
"NDBCLUSTER"
,
&
have_ndbcluster
,
"Clustered, fault-tolerant, memory-based tables"
,
DB_TYPE_NDBCLUSTER
},
"Clustered, fault-tolerant, memory-based tables"
,
DB_TYPE_NDBCLUSTER
,
NULL
},
{
"NDB"
,
&
have_ndbcluster
,
"Alias for NDBCLUSTER"
,
DB_TYPE_NDBCLUSTER
},
{
"EXAMPLE"
,
&
have_example_db
,
{
"EXAMPLE"
,
&
have_example_db
,
"Example storage engine"
,
DB_TYPE_EXAMPLE_DB
},
"Example storage engine"
,
DB_TYPE_EXAMPLE_DB
,
NULL
},
{
"ARCHIVE"
,
&
have_archive_db
,
{
"ARCHIVE"
,
&
have_archive_db
,
"Archive storage engine"
,
DB_TYPE_ARCHIVE_DB
},
"Archive storage engine"
,
DB_TYPE_ARCHIVE_DB
,
NULL
},
{
"CSV"
,
&
have_csv_db
,
{
"CSV"
,
&
have_csv_db
,
"CSV storage engine"
,
DB_TYPE_CSV_DB
},
"CSV storage engine"
,
DB_TYPE_CSV_DB
,
NULL
},
{
"FEDERATED"
,
&
have_federated_db
,
{
"FEDERATED"
,
&
have_federated_db
,
"Federated MySQL storage engine"
,
DB_TYPE_FEDERATED_DB
},
"Federated MySQL storage engine"
,
DB_TYPE_FEDERATED_DB
,
NULL
},
{
"BLACKHOLE"
,
&
have_blackhole_db
,
{
"BLACKHOLE"
,
&
have_blackhole_db
,
"/dev/null storage engine (anything you write to it disappears)"
,
"/dev/null storage engine (anything you write to it disappears)"
,
DB_TYPE_BLACKHOLE_DB
},
DB_TYPE_BLACKHOLE_DB
,
NULL
},
{
NullS
,
NULL
,
NullS
,
DB_TYPE_UNKNOWN
}
{
NullS
,
NULL
,
NullS
,
DB_TYPE_UNKNOWN
,
NULL
}
};
struct
show_table_alias_st
sys_table_aliases
[]
=
{
{
"INNOBASE"
,
"InnoDB"
,
NULL
},
{
"NDB"
,
"NDBCLUSTER"
,
NULL
},
{
"BDB"
,
"BERKELEYDB"
,
NULL
},
{
"HEAP"
,
"MEMORY"
,
NULL
},
{
"MERGE"
,
"MRG_MYISAM"
,
NULL
},
{
NullS
,
NullS
,
NULL
}
};
};
const
char
*
ha_row_type
[]
=
{
const
char
*
ha_row_type
[]
=
{
...
@@ -124,16 +143,27 @@ uint known_extensions_id= 0;
...
@@ -124,16 +143,27 @@ uint known_extensions_id= 0;
enum
db_type
ha_resolve_by_name
(
const
char
*
name
,
uint
namelen
)
enum
db_type
ha_resolve_by_name
(
const
char
*
name
,
uint
namelen
)
{
{
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
show_table_alias_st
*
table_alias
;
show_table_type_st
*
types
;
if
(
thd
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
name
,
"DEFAULT"
))
{
if
(
thd
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
name
,
"DEFAULT"
))
{
return
(
enum
db_type
)
thd
->
variables
.
table_type
;
return
(
enum
db_type
)
thd
->
variables
.
table_type
;
}
}
show_table_type_st
*
types
;
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
{
{
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
name
,
types
->
type
))
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
name
,
types
->
type
))
return
(
enum
db_type
)
types
->
db_type
;
return
(
enum
db_type
)
types
->
db_type
;
}
}
/*
We check for the historical aliases next.
*/
for
(
table_alias
=
sys_table_aliases
;
table_alias
->
type
;
table_alias
++
)
{
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
name
,
table_alias
->
alias
)
&&
table_alias
->
st
)
return
(
enum
db_type
)
table_alias
->
st
->
db_type
;
}
return
DB_TYPE_UNKNOWN
;
return
DB_TYPE_UNKNOWN
;
}
}
...
@@ -361,23 +391,39 @@ int ha_init()
...
@@ -361,23 +391,39 @@ int ha_init()
{
{
int
error
=
0
;
int
error
=
0
;
handlerton
**
ht
=
handlertons
;
handlerton
**
ht
=
handlertons
;
show_table_type_st
*
types
;
show_table_alias_st
*
table_alias
;
total_ha
=
savepoint_alloc_size
=
0
;
total_ha
=
savepoint_alloc_size
=
0
;
if
(
ha_init_errors
())
if
(
ha_init_errors
())
return
1
;
return
1
;
if
(
opt_bin_log
)
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
{
{
if
(
!
(
*
ht
=
binlog_init
()))
// Always succeed
switch
(
types
->
db_type
)
{
case
DB_TYPE_HEAP
:
types
->
ht
=
&
heap_hton
;
for
(
table_alias
=
sys_table_aliases
;
table_alias
->
type
;
table_alias
++
)
{
{
mysql_bin_log
.
close
(
LOG_CLOSE_INDEX
);
// Never used
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
types
->
ht
->
name
,
opt_bin_log
=
0
;
// Never used
table_alias
->
type
))
error
=
1
;
// Never used
table_alias
->
st
=
types
;
}
}
else
break
;
ha_was_inited_ok
(
ht
++
);
case
DB_TYPE_MYISAM
:
types
->
ht
=
&
myisam_hton
;
break
;
case
DB_TYPE_MRG_MYISAM
:
types
->
ht
=
&
myisammrg_hton
;
for
(
table_alias
=
sys_table_aliases
;
table_alias
->
type
;
table_alias
++
)
{
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
types
->
ht
->
name
,
table_alias
->
type
))
table_alias
->
st
=
types
;
}
}
break
;
#ifdef HAVE_BERKELEY_DB
#ifdef HAVE_BERKELEY_DB
case
DB_TYPE_BERKELEY_DB
:
if
(
have_berkeley_db
==
SHOW_OPTION_YES
)
if
(
have_berkeley_db
==
SHOW_OPTION_YES
)
{
{
if
(
!
(
*
ht
=
berkeley_init
()))
if
(
!
(
*
ht
=
berkeley_init
()))
...
@@ -386,10 +432,20 @@ int ha_init()
...
@@ -386,10 +432,20 @@ int ha_init()
error
=
1
;
error
=
1
;
}
}
else
else
{
types
->
ht
=
&
berkeley_hton
;
for
(
table_alias
=
sys_table_aliases
;
table_alias
->
type
;
table_alias
++
)
{
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
types
->
ht
->
name
,
table_alias
->
type
))
table_alias
->
st
=
types
;
}
ha_was_inited_ok
(
ht
++
);
ha_was_inited_ok
(
ht
++
);
}
}
}
break
;
#endif
#endif
#ifdef HAVE_INNOBASE_DB
#ifdef HAVE_INNOBASE_DB
case
DB_TYPE_INNODB
:
if
(
have_innodb
==
SHOW_OPTION_YES
)
if
(
have_innodb
==
SHOW_OPTION_YES
)
{
{
if
(
!
(
*
ht
=
innobase_init
()))
if
(
!
(
*
ht
=
innobase_init
()))
...
@@ -398,10 +454,20 @@ int ha_init()
...
@@ -398,10 +454,20 @@ int ha_init()
error
=
1
;
error
=
1
;
}
}
else
else
{
ha_was_inited_ok
(
ht
++
);
ha_was_inited_ok
(
ht
++
);
types
->
ht
=
&
innobase_hton
;
for
(
table_alias
=
sys_table_aliases
;
table_alias
->
type
;
table_alias
++
)
{
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
types
->
ht
->
name
,
table_alias
->
type
))
table_alias
->
st
=
types
;
}
}
}
}
break
;
#endif
#endif
#ifdef HAVE_NDBCLUSTER_DB
#ifdef HAVE_NDBCLUSTER_DB
case
DB_TYPE_NDBCLUSTER
:
if
(
have_ndbcluster
==
SHOW_OPTION_YES
)
if
(
have_ndbcluster
==
SHOW_OPTION_YES
)
{
{
if
(
!
(
*
ht
=
ndbcluster_init
()))
if
(
!
(
*
ht
=
ndbcluster_init
()))
...
@@ -410,10 +476,47 @@ int ha_init()
...
@@ -410,10 +476,47 @@ int ha_init()
error
=
1
;
error
=
1
;
}
}
else
else
{
ha_was_inited_ok
(
ht
++
);
types
->
ht
=
&
ndbcluster_hton
;
for
(
table_alias
=
sys_table_aliases
;
table_alias
->
type
;
table_alias
++
)
{
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
types
->
ht
->
name
,
table_alias
->
type
))
table_alias
->
st
=
types
;
}
}
}
break
;
#endif
#ifdef HAVE_EXAMPLE_DB
case
DB_TYPE_EXAMPLE_DB
:
types
->
ht
=
&
example_hton
;
break
;
#endif
#ifdef HAVE_ARCHIVE_DB
case
DB_TYPE_ARCHIVE_DB
:
if
(
have_archive_db
==
SHOW_OPTION_YES
)
{
if
(
!
(
*
ht
=
archive_db_init
()))
{
have_archive_db
=
SHOW_OPTION_DISABLED
;
error
=
1
;
}
else
{
ha_was_inited_ok
(
ht
++
);
ha_was_inited_ok
(
ht
++
);
types
->
ht
=
&
archive_hton
;
}
}
}
break
;
#endif
#ifdef HAVE_CSV_DB
case
DB_TYPE_CSV_DB
,:
types
->
ht
=
&
tina_hton
;
break
;
#endif
#endif
#ifdef HAVE_FEDERATED_DB
#ifdef HAVE_FEDERATED_DB
case
DB_TYPE_FEDERATED_DB
:
if
(
have_federated_db
==
SHOW_OPTION_YES
)
if
(
have_federated_db
==
SHOW_OPTION_YES
)
{
{
if
(
federated_db_init
())
if
(
federated_db_init
())
...
@@ -421,20 +524,34 @@ int ha_init()
...
@@ -421,20 +524,34 @@ int ha_init()
have_federated_db
=
SHOW_OPTION_DISABLED
;
have_federated_db
=
SHOW_OPTION_DISABLED
;
error
=
1
;
error
=
1
;
}
}
else
{
types
->
ht
=
&
federated_hton
;
}
}
}
break
;
#endif
#endif
#ifdef HAVE_ARCHIVE_DB
#ifdef HAVE_BLACKHOLE_DB
if
(
have_archive_db
==
SHOW_OPTION_YES
)
case
DB_TYPE_BLACKHOLE_DB
:
types
->
ht
=
&
blackhole_hton
;
break
;
#endif
default:
types
->
ht
=
NULL
;
}
}
if
(
opt_bin_log
)
{
{
if
(
!
(
*
ht
=
archive_db_init
()))
if
(
!
(
*
ht
=
binlog_init
()))
// Always succeed
{
{
have_archive_db
=
SHOW_OPTION_DISABLED
;
mysql_bin_log
.
close
(
LOG_CLOSE_INDEX
);
// Never used
error
=
1
;
opt_bin_log
=
0
;
// Never used
error
=
1
;
// Never used
}
}
else
else
ha_was_inited_ok
(
ht
++
);
ha_was_inited_ok
(
ht
++
);
}
}
#endif
DBUG_ASSERT
(
total_ha
<
MAX_HA
);
DBUG_ASSERT
(
total_ha
<
MAX_HA
);
/*
/*
Check if there is a transaction-capable storage engine besides the
Check if there is a transaction-capable storage engine besides the
...
...
sql/handler.h
View file @
09c88914
...
@@ -177,13 +177,6 @@ enum db_type
...
@@ -177,13 +177,6 @@ enum db_type
DB_TYPE_DEFAULT
// Must be last
DB_TYPE_DEFAULT
// Must be last
};
};
struct
show_table_type_st
{
const
char
*
type
;
SHOW_COMP_OPTION
*
value
;
const
char
*
comment
;
enum
db_type
db_type
;
};
enum
row_type
{
ROW_TYPE_NOT_USED
=-
1
,
ROW_TYPE_DEFAULT
,
ROW_TYPE_FIXED
,
enum
row_type
{
ROW_TYPE_NOT_USED
=-
1
,
ROW_TYPE_DEFAULT
,
ROW_TYPE_FIXED
,
ROW_TYPE_DYNAMIC
,
ROW_TYPE_COMPRESSED
,
ROW_TYPE_DYNAMIC
,
ROW_TYPE_COMPRESSED
,
ROW_TYPE_REDUNDANT
,
ROW_TYPE_COMPACT
};
ROW_TYPE_REDUNDANT
,
ROW_TYPE_COMPACT
};
...
@@ -363,6 +356,20 @@ typedef struct
...
@@ -363,6 +356,20 @@ typedef struct
uint32
flags
;
/* global handler flags */
uint32
flags
;
/* global handler flags */
}
handlerton
;
}
handlerton
;
struct
show_table_type_st
{
const
char
*
type
;
SHOW_COMP_OPTION
*
value
;
const
char
*
comment
;
enum
db_type
db_type
;
handlerton
*
ht
;
};
struct
show_table_alias_st
{
const
char
*
alias
;
const
char
*
type
;
show_table_type_st
*
st
;
};
/* Possible flags of a handlerton */
/* Possible flags of a handlerton */
#define HTON_NO_FLAGS 0
#define HTON_NO_FLAGS 0
#define HTON_CLOSE_CURSORS_AT_COMMIT 1
#define HTON_CLOSE_CURSORS_AT_COMMIT 1
...
...
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