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
5048aa82
Commit
5048aa82
authored
Apr 16, 2005
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge serg@bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
parents
5fe52ffb
ab939dce
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
7 deletions
+59
-7
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+23
-5
sql/handler.cc
sql/handler.cc
+14
-0
sql/handler.h
sql/handler.h
+1
-0
sql/mysqld.cc
sql/mysqld.cc
+13
-0
support-files/mysql.server.sh
support-files/mysql.server.sh
+8
-2
No files found.
sql/ha_ndbcluster.cc
View file @
5048aa82
...
@@ -47,6 +47,8 @@ static const char *ha_ndb_ext=".ndb";
...
@@ -47,6 +47,8 @@ static const char *ha_ndb_ext=".ndb";
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0
#define NDB_AUTO_INCREMENT_RETRIES 10
#define ERR_PRINT(err) \
#define ERR_PRINT(err) \
DBUG_PRINT("error", ("%d message: %s", err.code, err.message))
DBUG_PRINT("error", ("%d message: %s", err.code, err.message))
...
@@ -1838,7 +1840,15 @@ int ha_ndbcluster::write_row(byte *record)
...
@@ -1838,7 +1840,15 @@ int ha_ndbcluster::write_row(byte *record)
{
{
// Table has hidden primary key
// Table has hidden primary key
Ndb
*
ndb
=
get_ndb
();
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
->
fields
,
(
const
byte
*
)
&
auto_value
))
if
(
set_hidden_key
(
op
,
table
->
fields
,
(
const
byte
*
)
&
auto_value
))
ERR_RETURN
(
op
->
getNdbError
());
ERR_RETURN
(
op
->
getNdbError
());
}
}
...
@@ -3971,10 +3981,18 @@ longlong ha_ndbcluster::get_auto_increment()
...
@@ -3971,10 +3981,18 @@ longlong ha_ndbcluster::get_auto_increment()
:
(
m_rows_to_insert
>
m_autoincrement_prefetch
)
?
:
(
m_rows_to_insert
>
m_autoincrement_prefetch
)
?
m_rows_to_insert
m_rows_to_insert
:
m_autoincrement_prefetch
;
:
m_autoincrement_prefetch
;
Uint64
auto_value
=
Uint64
auto_value
=
NDB_FAILED_AUTO_INCREMENT
;
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
do
{
auto_value
=
(
m_skip_auto_increment
)
?
(
m_skip_auto_increment
)
?
ndb
->
readAutoIncrementValue
((
const
NDBTAB
*
)
m_table
)
ndb
->
readAutoIncrementValue
((
const
NDBTAB
*
)
m_table
)
:
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
,
cache_size
);
:
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
);
DBUG_RETURN
((
longlong
)
auto_value
);
}
}
...
...
sql/handler.cc
View file @
5048aa82
...
@@ -145,6 +145,20 @@ const char *ha_get_storage_engine(enum db_type db_type)
...
@@ -145,6 +145,20 @@ const char *ha_get_storage_engine(enum db_type db_type)
return
"none"
;
return
"none"
;
}
}
my_bool
ha_storage_engine_is_enabled
(
enum
db_type
database_type
)
{
show_table_type_st
*
types
;
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
{
if
((
database_type
==
types
->
db_type
)
&&
(
*
types
->
value
==
SHOW_OPTION_YES
))
return
TRUE
;
}
return
FALSE
;
}
/* Use other database handler if databasehandler is not incompiled */
/* Use other database handler if databasehandler is not incompiled */
enum
db_type
ha_checktype
(
enum
db_type
database_type
)
enum
db_type
ha_checktype
(
enum
db_type
database_type
)
...
...
sql/handler.h
View file @
5048aa82
...
@@ -542,6 +542,7 @@ int ha_init(void);
...
@@ -542,6 +542,7 @@ int ha_init(void);
int
ha_panic
(
enum
ha_panic_function
flag
);
int
ha_panic
(
enum
ha_panic_function
flag
);
void
ha_close_connection
(
THD
*
thd
);
void
ha_close_connection
(
THD
*
thd
);
enum
db_type
ha_checktype
(
enum
db_type
database_type
);
enum
db_type
ha_checktype
(
enum
db_type
database_type
);
my_bool
ha_storage_engine_is_enabled
(
enum
db_type
database_type
);
int
ha_create_table
(
const
char
*
name
,
HA_CREATE_INFO
*
create_info
,
int
ha_create_table
(
const
char
*
name
,
HA_CREATE_INFO
*
create_info
,
bool
update_create_info
);
bool
update_create_info
);
int
ha_create_table_from_engine
(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
,
int
ha_create_table_from_engine
(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
,
...
...
sql/mysqld.cc
View file @
5048aa82
...
@@ -1165,6 +1165,7 @@ static struct passwd *check_user(const char *user)
...
@@ -1165,6 +1165,7 @@ static struct passwd *check_user(const char *user)
err:
err:
sql_print_error
(
"Fatal error: Can't change to run as user '%s' ; Please check that the user exists!
\n
"
,
user
);
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
#endif
return
NULL
;
return
NULL
;
}
}
...
@@ -6435,6 +6436,18 @@ static void get_options(int argc,char **argv)
...
@@ -6435,6 +6436,18 @@ static void get_options(int argc,char **argv)
sql_print_warning
(
"this binary does not contain BDB storage engine"
);
sql_print_warning
(
"this binary does not contain BDB storage engine"
);
#endif
#endif
/*
Check that the default storage engine is actually available.
*/
if
(
!
ha_storage_engine_is_enabled
((
enum
db_type
)
global_system_variables
.
table_type
))
{
sql_print_error
(
"Default storage engine (%s) is not available"
,
ha_get_storage_engine
((
enum
db_type
)
global_system_variables
.
table_type
));
exit
(
1
);
}
if
(
argc
>
0
)
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
);
fprintf
(
stderr
,
"%s: Too many arguments (first extra is '%s').
\n
Use --help to get a list of available options
\n
"
,
my_progname
,
*
argv
);
...
...
support-files/mysql.server.sh
View file @
5048aa82
...
@@ -61,8 +61,14 @@ lsb_functions="/lib/lsb/init-functions"
...
@@ -61,8 +61,14 @@ lsb_functions="/lib/lsb/init-functions"
if
test
-f
$lsb_functions
;
then
if
test
-f
$lsb_functions
;
then
source
$lsb_functions
source
$lsb_functions
else
else
alias
log_success_msg
=
"echo
\
SUCCESS! "
log_success_msg
()
alias
log_failure_msg
=
"echo
\
ERROR! "
{
echo
" SUCCESS!
$@
"
}
log_failure_msg
()
{
echo
" ERROR!
$@
"
}
fi
fi
PATH
=
/sbin:/usr/sbin:/bin:/usr/bin:
$basedir
/bin
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