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
0a27eef8
Commit
0a27eef8
authored
20 years ago
by
acurtis@pcgem.rdg.cyberkinetica.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup ha_checktype() and redundant variables.
parent
7f3771bc
Branches unavailable
Tags unavailable
No related merge requests found
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
70 deletions
+40
-70
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+1
-1
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+1
-1
sql/ha_berkeley.h
sql/ha_berkeley.h
+1
-1
sql/ha_innodb.cc
sql/ha_innodb.cc
+1
-2
sql/ha_innodb.h
sql/ha_innodb.h
+0
-1
sql/ha_isam.cc
sql/ha_isam.cc
+0
-1
sql/ha_isam.h
sql/ha_isam.h
+0
-1
sql/handler.cc
sql/handler.cc
+34
-42
sql/mysqld.cc
sql/mysqld.cc
+1
-19
sql/sql_show.cc
sql/sql_show.cc
+1
-1
No files found.
libmysqld/lib_sql.cc
View file @
0a27eef8
...
...
@@ -419,7 +419,7 @@ int init_embedded_server(int argc, char **argv, char **groups)
if
(
#ifdef HAVE_BERKELEY_DB
!
berkeley_skip
||
(
have_berkeley_db
==
SHOW_OPTION_YES
)
||
#endif
(
flush_time
&&
flush_time
!=
~
(
ulong
)
0L
))
{
...
...
This diff is collapsed.
Click to expand it.
sql/ha_berkeley.cc
View file @
0a27eef8
...
...
@@ -72,7 +72,7 @@
#define STATUS_BDB_ANALYZE 4
const
char
*
ha_berkeley_ext
=
".db"
;
bool
berkeley_s
kip
=
0
,
berkeley_s
hared_data
=
0
;
bool
berkeley_shared_data
=
0
;
u_int32_t
berkeley_init_flags
=
DB_PRIVATE
|
DB_RECOVER
,
berkeley_env_flags
=
0
,
berkeley_lock_type
=
DB_LOCK_DEFAULT
;
ulong
berkeley_cache_size
,
berkeley_log_buffer_size
,
berkeley_log_file_size
=
0
;
...
...
This diff is collapsed.
Click to expand it.
sql/ha_berkeley.h
View file @
0a27eef8
...
...
@@ -170,7 +170,7 @@ class ha_berkeley: public handler
uint8
table_cache_type
()
{
return
HA_CACHE_TBL_TRANSACT
;
}
};
extern
bool
berkeley_s
kip
,
berkeley_s
hared_data
;
extern
bool
berkeley_shared_data
;
extern
u_int32_t
berkeley_init_flags
,
berkeley_env_flags
,
berkeley_lock_type
,
berkeley_lock_types
[];
extern
ulong
berkeley_cache_size
,
berkeley_max_lock
,
berkeley_log_buffer_size
;
...
...
This diff is collapsed.
Click to expand it.
sql/ha_innodb.cc
View file @
0a27eef8
...
...
@@ -80,7 +80,6 @@ extern "C" {
#define HA_INNOBASE_ROWS_IN_TABLE 10000
/* to get optimization right */
#define HA_INNOBASE_RANGE_COUNT 100
bool
innodb_skip
=
0
;
uint
innobase_init_flags
=
0
;
ulong
innobase_cache_size
=
0
;
...
...
@@ -4758,7 +4757,7 @@ innodb_show_status(
DBUG_ENTER
(
"innodb_show_status"
);
if
(
innodb_skip
)
{
if
(
have_innodb
!=
SHOW_OPTION_YES
)
{
my_message
(
ER_NOT_SUPPORTED_YET
,
"Cannot call SHOW INNODB STATUS because skip-innodb is defined"
,
MYF
(
0
));
...
...
This diff is collapsed.
Click to expand it.
sql/ha_innodb.h
View file @
0a27eef8
...
...
@@ -190,7 +190,6 @@ class ha_innobase: public handler
uint8
table_cache_type
()
{
return
HA_CACHE_TBL_ASKTRANSACT
;
}
};
extern
bool
innodb_skip
;
extern
uint
innobase_init_flags
,
innobase_lock_type
;
extern
uint
innobase_flush_log_at_trx_commit
;
extern
ulong
innobase_cache_size
;
...
...
This diff is collapsed.
Click to expand it.
sql/ha_isam.cc
View file @
0a27eef8
...
...
@@ -34,7 +34,6 @@
** isam tables
*****************************************************************************/
bool
isam_skip
;
const
char
**
ha_isam
::
bas_ext
()
const
{
static
const
char
*
ext
[]
=
{
".ISM"
,
".ISD"
,
NullS
};
return
ext
;
}
...
...
This diff is collapsed.
Click to expand it.
sql/ha_isam.h
View file @
0a27eef8
...
...
@@ -82,4 +82,3 @@ class ha_isam: public handler
enum
thr_lock_type
lock_type
);
};
extern
bool
isam_skip
;
This diff is collapsed.
Click to expand it.
sql/handler.cc
View file @
0a27eef8
...
...
@@ -120,34 +120,21 @@ const char *ha_get_storage_engine(enum db_type db_type)
enum
db_type
ha_checktype
(
enum
db_type
database_type
)
{
show_table_type_st
*
types
;
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
{
if
((
database_type
==
types
->
db_type
)
&&
(
SHOW_OPTION_YES
==
*
types
->
value
))
return
database_type
;
}
switch
(
database_type
)
{
#ifdef HAVE_BERKELEY_DB
case
DB_TYPE_BERKELEY_DB
:
if
(
berkeley_skip
)
break
;
return
(
database_type
);
#endif
#ifdef HAVE_INNOBASE_DB
case
DB_TYPE_INNODB
:
if
(
innodb_skip
)
break
;
return
(
database_type
);
#endif
#ifndef NO_HASH
case
DB_TYPE_HASH
:
#endif
#ifdef HAVE_ISAM
case
DB_TYPE_ISAM
:
if
(
isam_skip
)
break
;
return
(
database_type
);
case
DB_TYPE_MRG_ISAM
:
return
(
isam_skip
?
DB_TYPE_MRG_MYISAM
:
database_type
);
#else
#endif
case
DB_TYPE_MRG_ISAM
:
return
(
DB_TYPE_MRG_MYISAM
);
#endif
case
DB_TYPE_HEAP
:
case
DB_TYPE_MYISAM
:
case
DB_TYPE_MRG_MYISAM
:
return
(
database_type
);
/* Database exists on system */
default:
break
;
}
...
...
@@ -165,6 +152,7 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
{
switch
(
db_type
)
{
#ifndef NO_HASH
case
DB_TYPE_HASH
:
return
new
ha_hash
(
table
);
#endif
#ifdef HAVE_ISAM
...
...
@@ -203,30 +191,32 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
int
ha_init
()
{
int
error
=
0
;
#ifdef HAVE_BERKELEY_DB
if
(
!
berkeley_skip
)
if
(
have_berkeley_db
==
SHOW_OPTION_YES
)
{
i
nt
error
;
if
((
error
=
berkeley_init
()))
return
error
;
if
(
!
berkeley_skip
)
// If we couldn't use handler
opt_using_transactions
=
1
;
i
f
(
berkeley_init
())
{
have_berkeley_db
=
SHOW_OPTION_DISABLED
;
// If we couldn't use handler
error
=
1
;
}
else
have_berkeley_db
=
SHOW_OPTION_DISABLED
;
opt_using_transactions
=
1
;
}
#endif
#ifdef HAVE_INNOBASE_DB
if
(
!
innodb_skip
)
if
(
have_innodb
==
SHOW_OPTION_YES
)
{
if
(
innobase_init
())
return
-
1
;
if
(
!
innodb_skip
)
// If we couldn't use handler
opt_using_transactions
=
1
;
{
have_innodb
=
SHOW_OPTION_DISABLED
;
// If we couldn't use handler
error
=
1
;
}
else
have_innodb
=
SHOW_OPTION_DISABLED
;
opt_using_transactions
=
1
;
}
#endif
return
0
;
return
error
;
}
/* close, flush or restart databases */
...
...
@@ -246,11 +236,11 @@ int ha_panic(enum ha_panic_function flag)
error
|=
mi_panic
(
flag
);
error
|=
myrg_panic
(
flag
);
#ifdef HAVE_BERKELEY_DB
if
(
!
berkeley_skip
)
if
(
have_berkeley_db
==
SHOW_OPTION_YES
)
error
|=
berkeley_end
();
#endif
#ifdef HAVE_INNOBASE_DB
if
(
!
innodb_skip
)
if
(
have_innodb
==
SHOW_OPTION_YES
)
error
|=
innobase_end
();
#endif
return
error
;
...
...
@@ -259,7 +249,7 @@ int ha_panic(enum ha_panic_function flag)
void
ha_drop_database
(
char
*
path
)
{
#ifdef HAVE_INNOBASE_DB
if
(
!
innodb_skip
)
if
(
have_innodb
==
SHOW_OPTION_YES
)
innobase_drop_database
(
path
);
#endif
}
...
...
@@ -267,7 +257,7 @@ void ha_drop_database(char* path)
void
ha_close_connection
(
THD
*
thd
)
{
#ifdef HAVE_INNOBASE_DB
if
(
!
innodb_skip
)
if
(
have_innodb
==
SHOW_OPTION_YES
)
innobase_close_connection
(
thd
);
#endif
}
...
...
@@ -632,11 +622,13 @@ bool ha_flush_logs()
{
bool
result
=
0
;
#ifdef HAVE_BERKELEY_DB
if
(
!
berkeley_skip
&&
berkeley_flush_logs
())
if
((
have_berkeley_db
==
SHOW_OPTION_YES
)
&&
berkeley_flush_logs
())
result
=
1
;
#endif
#ifdef HAVE_INNOBASE_DB
if
(
!
innodb_skip
&&
innobase_flush_logs
())
if
((
have_innodb
==
SHOW_OPTION_YES
)
&&
innobase_flush_logs
())
result
=
1
;
#endif
return
result
;
...
...
This diff is collapsed.
Click to expand it.
sql/mysqld.cc
View file @
0a27eef8
...
...
@@ -2362,7 +2362,7 @@ static void create_maintenance_thread()
{
if
(
#ifdef HAVE_BERKELEY_DB
!
berkeley_skip
||
(
have_berkeley_db
==
SHOW_OPTION_YES
)
||
#endif
(
flush_time
&&
flush_time
!=
~
(
ulong
)
0L
))
{
...
...
@@ -5532,43 +5532,25 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case
OPT_BDB
:
#ifdef HAVE_BERKELEY_DB
if
(
opt_bdb
)
{
berkeley_skip
=
0
;
have_berkeley_db
=
SHOW_OPTION_YES
;
}
else
{
berkeley_skip
=
1
;
have_berkeley_db
=
SHOW_OPTION_DISABLED
;
}
#endif
break
;
case
OPT_ISAM
:
#ifdef HAVE_ISAM
if
(
opt_isam
)
{
isam_skip
=
0
;
have_isam
=
SHOW_OPTION_YES
;
}
else
{
isam_skip
=
1
;
have_isam
=
SHOW_OPTION_DISABLED
;
}
#endif
break
;
case
OPT_INNODB
:
#ifdef HAVE_INNOBASE_DB
if
(
opt_innodb
)
{
innodb_skip
=
0
;
have_innodb
=
SHOW_OPTION_YES
;
}
else
{
innodb_skip
=
1
;
have_innodb
=
SHOW_OPTION_DISABLED
;
}
#endif
break
;
case
OPT_INNODB_DATA_FILE_PATH
:
...
...
This diff is collapsed.
Click to expand it.
sql/sql_show.cc
View file @
0a27eef8
...
...
@@ -921,7 +921,7 @@ mysqld_show_logs(THD *thd)
DBUG_RETURN
(
1
);
#ifdef HAVE_BERKELEY_DB
if
(
!
berkeley_skip
&&
berkeley_show_logs
(
protocol
))
if
(
(
have_berkeley_db
==
SHOW_OPTION_YES
)
&&
berkeley_show_logs
(
protocol
))
DBUG_RETURN
(
-
1
);
#endif
...
...
This diff is collapsed.
Click to expand it.
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