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
c8170b34
Commit
c8170b34
authored
Apr 16, 2005
by
monty@mishka.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge with 4.1
parents
f0fa1a6f
2b322f36
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
18 deletions
+77
-18
scripts/mysql_create_system_tables.sh
scripts/mysql_create_system_tables.sh
+1
-0
scripts/mysql_fix_privilege_tables.sql
scripts/mysql_fix_privilege_tables.sql
+2
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+23
-5
sql/handler.cc
sql/handler.cc
+15
-5
sql/handler.h
sql/handler.h
+1
-0
sql/mysqld.cc
sql/mysqld.cc
+25
-4
sql/set_var.cc
sql/set_var.cc
+2
-2
support-files/mysql.server.sh
support-files/mysql.server.sh
+8
-2
No files found.
scripts/mysql_create_system_tables.sh
View file @
c8170b34
...
...
@@ -722,6 +722,7 @@ fi
cat
<<
END_OF_DATA
use mysql;
set table_type=myisam;
$c_d
$i_d
...
...
scripts/mysql_fix_privilege_tables.sql
View file @
c8170b34
...
...
@@ -9,6 +9,8 @@
-- this sql script.
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
set
table_type
=
MyISAM
;
CREATE
TABLE
IF
NOT
EXISTS
func
(
name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
ret
tinyint
(
1
)
DEFAULT
'0'
NOT
NULL
,
...
...
sql/ha_ndbcluster.cc
View file @
c8170b34
...
...
@@ -67,6 +67,8 @@ static handlerton ndbcluster_hton = {
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0
#define NDB_AUTO_INCREMENT_RETRIES 10
#define ERR_PRINT(err) \
DBUG_PRINT("error", ("%d message: %s", err.code, err.message))
...
...
@@ -1928,7 +1930,15 @@ int ha_ndbcluster::write_row(byte *record)
{
// Table has hidden primary key
Ndb
*
ndb
=
get_ndb
();
Uint64
auto_value
=
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
);
Uint64
auto_value
=
NDB_FAILED_AUTO_INCREMENT
;
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
do
{
auto_value
=
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
);
}
while
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
&&
--
retries
&&
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
);
if
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
)
ERR_RETURN
(
ndb
->
getNdbError
());
if
(
set_hidden_key
(
op
,
table
->
s
->
fields
,
(
const
byte
*
)
&
auto_value
))
ERR_RETURN
(
op
->
getNdbError
());
}
...
...
@@ -4119,10 +4129,18 @@ ulonglong ha_ndbcluster::get_auto_increment()
:
(
m_rows_to_insert
>
m_autoincrement_prefetch
)
?
m_rows_to_insert
:
m_autoincrement_prefetch
;
auto_value
=
(
m_skip_auto_increment
)
?
ndb
->
readAutoIncrementValue
((
const
NDBTAB
*
)
m_table
)
:
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
,
cache_size
);
auto_value
=
NDB_FAILED_AUTO_INCREMENT
;
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
do
{
auto_value
=
(
m_skip_auto_increment
)
?
ndb
->
readAutoIncrementValue
((
const
NDBTAB
*
)
m_table
)
:
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
,
cache_size
);
}
while
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
&&
--
retries
&&
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
);
if
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
)
ERR_RETURN
(
ndb
->
getNdbError
());
DBUG_RETURN
((
longlong
)
auto_value
);
}
...
...
sql/handler.cc
View file @
c8170b34
...
...
@@ -149,18 +149,27 @@ const char *ha_get_storage_engine(enum db_type db_type)
return
"none"
;
}
/* Use other database handler if databasehandler is not incompiled */
enum
db_type
ha_checktype
(
enum
db_type
database_type
)
my_bool
ha_storage_engine_is_enabled
(
enum
db_type
database_type
)
{
show_table_type_st
*
types
;
THD
*
thd
=
current_thd
;
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
{
if
((
database_type
==
types
->
db_type
)
&&
if
((
database_type
==
types
->
db_type
)
&&
(
*
types
->
value
==
SHOW_OPTION_YES
))
return
database_type
;
return
TRUE
;
}
return
FALSE
;
}
/* Use other database handler if databasehandler is not incompiled */
enum
db_type
ha_checktype
(
enum
db_type
database_type
)
{
THD
*
thd
;
if
(
ha_storage_engine_is_enabled
(
database_type
))
return
database_type
;
switch
(
database_type
)
{
#ifndef NO_HASH
...
...
@@ -173,6 +182,7 @@ enum db_type ha_checktype(enum db_type database_type)
break
;
}
thd
=
current_thd
;
return
((
enum
db_type
)
thd
->
variables
.
table_type
!=
DB_TYPE_UNKNOWN
?
(
enum
db_type
)
thd
->
variables
.
table_type
:
(
enum
db_type
)
global_system_variables
.
table_type
!=
...
...
sql/handler.h
View file @
c8170b34
...
...
@@ -819,6 +819,7 @@ TYPELIB *ha_known_exts(void);
int
ha_panic
(
enum
ha_panic_function
flag
);
int
ha_update_statistics
();
void
ha_close_connection
(
THD
*
thd
);
my_bool
ha_storage_engine_is_enabled
(
enum
db_type
database_type
);
bool
ha_flush_logs
(
void
);
void
ha_drop_database
(
char
*
path
);
int
ha_create_table
(
const
char
*
name
,
HA_CREATE_INFO
*
create_info
,
...
...
sql/mysqld.cc
View file @
c8170b34
...
...
@@ -1185,6 +1185,7 @@ static struct passwd *check_user(const char *user)
err:
sql_print_error
(
"Fatal error: Can't change to run as user '%s' ; Please check that the user exists!
\n
"
,
user
);
unireg_abort
(
1
);
#endif
return
NULL
;
}
...
...
@@ -2436,8 +2437,10 @@ static int init_common_variables(const char *conf_file_name, int argc,
{
struct
tm
tm_tmp
;
localtime_r
(
&
start_time
,
&
tm_tmp
);
strmov
(
system_time_zone
,
tzname
[
tm_tmp
.
tm_isdst
!=
0
?
1
:
0
]);
}
strmake
(
system_time_zone
,
tzname
[
tm_tmp
.
tm_isdst
!=
0
?
1
:
0
],
sizeof
(
system_time_zone
)
-
1
);
}
#endif
/*
We set SYSTEM time zone as reasonable default and
...
...
@@ -3144,6 +3147,7 @@ we force server id to 2, but this MySQL server will not act as a slave.");
if
(
opt_bootstrap
)
{
select_thread_in_use
=
0
;
// Allow 'kill' to work
bootstrap
(
stdin
);
end_thr_alarm
(
1
);
// Don't allow alarms
unireg_abort
(
bootstrap_error
?
1
:
0
);
...
...
@@ -6383,9 +6387,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case
OPT_STORAGE_ENGINE
:
{
if
((
enum
db_type
)((
global_system_variables
.
table_type
=
ha_resolve_by_name
(
argument
,
strlen
(
argument
))))
==
DB_TYPE_UNKNOWN
)
ha_resolve_by_name
(
argument
,
strlen
(
argument
))))
==
DB_TYPE_UNKNOWN
)
{
fprintf
(
stderr
,
"Unknown table type: %s
\n
"
,
argument
);
fprintf
(
stderr
,
"Unknown
/unsupported
table type: %s
\n
"
,
argument
);
exit
(
1
);
}
break
;
...
...
@@ -6659,6 +6664,22 @@ static void get_options(int argc,char **argv)
sql_print_warning
(
"this binary does not contain BDB storage engine"
);
#endif
/*
Check that the default storage engine is actually available.
*/
if
(
!
ha_storage_engine_is_enabled
((
enum
db_type
)
global_system_variables
.
table_type
))
{
if
(
!
opt_bootstrap
)
{
sql_print_error
(
"Default storage engine (%s) is not available"
,
ha_get_storage_engine
((
enum
db_type
)
global_system_variables
.
table_type
));
exit
(
1
);
}
global_system_variables
.
table_type
=
DB_TYPE_MYISAM
;
}
if
(
argc
>
0
)
{
fprintf
(
stderr
,
"%s: Too many arguments (first extra is '%s').
\n
Use --help to get a list of available options
\n
"
,
my_progname
,
*
argv
);
...
...
sql/set_var.cc
View file @
c8170b34
...
...
@@ -3125,8 +3125,8 @@ bool sys_var_thd_storage_engine::check(THD *thd, set_var *var)
enum
db_type
db_type
;
if
(
!
(
res
=
var
->
value
->
val_str
(
&
str
))
||
!
(
var
->
save_result
.
ulong_value
=
(
ulong
)
(
db_type
=
ha_resolve_by_name
(
res
->
ptr
(),
res
->
length
())))
||
ha_checktype
(
db_type
)
!=
db_type
)
(
ulong
)
(
db_type
=
ha_resolve_by_name
(
res
->
ptr
(),
res
->
length
())))
||
ha_checktype
(
db_type
)
!=
db_type
)
{
value
=
res
?
res
->
c_ptr
()
:
"NULL"
;
goto
err
;
...
...
support-files/mysql.server.sh
View file @
c8170b34
...
...
@@ -66,8 +66,14 @@ lsb_functions="/lib/lsb/init-functions"
if
test
-f
$lsb_functions
;
then
source
$lsb_functions
else
alias
log_success_msg
=
"echo
\
SUCCESS! "
alias
log_failure_msg
=
"echo
\
ERROR! "
log_success_msg
()
{
echo
" SUCCESS!
$@
"
}
log_failure_msg
()
{
echo
" ERROR!
$@
"
}
fi
PATH
=
/sbin:/usr/sbin:/bin:/usr/bin:
$basedir
/bin
...
...
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