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
3e052e0f
Commit
3e052e0f
authored
Oct 02, 2009
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge Monty's fixes from main into release branch.
- MariaDB naming. - Error reporting with mysqld --help --verbose.
parents
ef639e9d
820c4902
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
11 deletions
+45
-11
client/mysql.cc
client/mysql.cc
+13
-5
configure.in
configure.in
+1
-1
include/mysql.h
include/mysql.h
+2
-0
include/mysql.h.pp
include/mysql.h.pp
+2
-0
libmysql/libmysql.c
libmysql/libmysql.c
+12
-0
mysql-test/r/mysqld_option_err.result
mysql-test/r/mysqld_option_err.result
+2
-0
mysql-test/t/mysqld_option_err.test
mysql-test/t/mysqld_option_err.test
+9
-0
sql/mysqld.cc
sql/mysqld.cc
+4
-5
No files found.
client/mysql.cc
View file @
3e052e0f
...
...
@@ -43,7 +43,7 @@
#include <locale.h>
#endif
const
char
*
VER
=
"14.1
5
"
;
const
char
*
VER
=
"14.1
6
"
;
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
...
...
@@ -1076,7 +1076,7 @@ int main(int argc,char *argv[])
delimiter_str
=
delimiter
;
default_prompt
=
my_strdup
(
getenv
(
"MYSQL_PS1"
)
?
getenv
(
"MYSQL_PS1"
)
:
"
mysql
> "
,
MYF
(
MY_WME
));
"
\\
N [
\\
d]
> "
,
MYF
(
MY_WME
));
current_prompt
=
my_strdup
(
default_prompt
,
MYF
(
MY_WME
));
prompt_counter
=
0
;
...
...
@@ -1156,10 +1156,11 @@ int main(int argc,char *argv[])
signal
(
SIGINT
,
handle_sigint
);
// Catch SIGINT to clean up
signal
(
SIGQUIT
,
mysql_end
);
// Catch SIGQUIT to clean up
put_info
(
"Welcome to the M
ySQL
monitor. Commands end with ; or
\\
g."
,
put_info
(
"Welcome to the M
ariaDB
monitor. Commands end with ; or
\\
g."
,
INFO_INFO
);
sprintf
((
char
*
)
glob_buffer
.
ptr
(),
"Your MySQL connection id is %lu
\n
Server version: %s
\n
"
,
"Your %s connection id is %lu
\n
Server version: %s
\n
"
,
mysql_get_server_name
(
&
mysql
),
mysql_thread_id
(
&
mysql
),
server_version_string
(
&
mysql
));
put_info
((
char
*
)
glob_buffer
.
ptr
(),
INFO_INFO
);
...
...
@@ -4369,6 +4370,7 @@ com_status(String *buffer __attribute__((unused)),
tee_fprintf
(
stdout
,
"Using outfile:
\t\t
'%s'
\n
"
,
opt_outfile
?
outfile
:
""
);
#endif
tee_fprintf
(
stdout
,
"Using delimiter:
\t
%s
\n
"
,
delimiter
);
tee_fprintf
(
stdout
,
"Server:
\t\t\t
%s
\n
"
,
mysql_get_server_name
(
&
mysql
));
tee_fprintf
(
stdout
,
"Server version:
\t\t
%s
\n
"
,
server_version_string
(
&
mysql
));
tee_fprintf
(
stdout
,
"Protocol version:
\t
%d
\n
"
,
mysql_get_proto_info
(
&
mysql
));
tee_fprintf
(
stdout
,
"Connection:
\t\t
%s
\n
"
,
mysql_get_host_info
(
&
mysql
));
...
...
@@ -4700,7 +4702,7 @@ static void mysql_end_timer(ulong start_time,char *buff)
strmov
(
strend
(
buff
),
")"
);
}
static
const
char
*
construct_prompt
()
static
const
char
*
construct_prompt
()
{
processed_prompt
.
free
();
// Erase the old prompt
time_t
lclock
=
time
(
NULL
);
// Get the date struct
...
...
@@ -4729,6 +4731,12 @@ static const char* construct_prompt()
case
'd'
:
processed_prompt
.
append
(
current_db
?
current_db
:
"(none)"
);
break
;
case
'N'
:
if
(
connected
)
processed_prompt
.
append
(
mysql_get_server_name
(
&
mysql
));
else
processed_prompt
.
append
(
"unknown"
);
break
;
case
'h'
:
{
const
char
*
prompt
;
...
...
configure.in
View file @
3e052e0f
...
...
@@ -13,7 +13,7 @@ AC_CANONICAL_SYSTEM
#
# When merging new MySQL releases, update the version number to match the
# MySQL version number, but reset the maria subrelease (-beta1).
AM_INIT_AUTOMAKE
(
mysql, 5.1.38-
maria
-beta1
)
AM_INIT_AUTOMAKE
(
mysql, 5.1.38-
MariaDB
-beta1
)
AM_CONFIG_HEADER
([
include/config.h:config.h.in]
)
PROTOCOL_VERSION
=
10
...
...
include/mysql.h
View file @
3e052e0f
...
...
@@ -527,6 +527,7 @@ int STDCALL mysql_set_server_option(MYSQL *mysql,
int
STDCALL
mysql_ping
(
MYSQL
*
mysql
);
const
char
*
STDCALL
mysql_stat
(
MYSQL
*
mysql
);
const
char
*
STDCALL
mysql_get_server_info
(
MYSQL
*
mysql
);
const
char
*
STDCALL
mysql_get_server_name
(
MYSQL
*
mysql
);
const
char
*
STDCALL
mysql_get_client_info
(
void
);
unsigned
long
STDCALL
mysql_get_client_version
(
void
);
const
char
*
STDCALL
mysql_get_host_info
(
MYSQL
*
mysql
);
...
...
@@ -560,6 +561,7 @@ void STDCALL mysql_debug(const char *debug);
void
STDCALL
myodbc_remove_escape
(
MYSQL
*
mysql
,
char
*
name
);
unsigned
int
STDCALL
mysql_thread_safe
(
void
);
my_bool
STDCALL
mysql_embedded
(
void
);
my_bool
STDCALL
mariadb_connection
(
MYSQL
*
mysql
);
MYSQL_MANAGER
*
STDCALL
mysql_manager_init
(
MYSQL_MANAGER
*
con
);
MYSQL_MANAGER
*
STDCALL
mysql_manager_connect
(
MYSQL_MANAGER
*
con
,
const
char
*
host
,
...
...
include/mysql.h.pp
View file @
3e052e0f
...
...
@@ -487,6 +487,7 @@ int mysql_set_server_option(MYSQL *mysql,
int
mysql_ping
(
MYSQL
*
mysql
);
const
char
*
mysql_stat
(
MYSQL
*
mysql
);
const
char
*
mysql_get_server_info
(
MYSQL
*
mysql
);
const
char
*
mysql_get_server_name
(
MYSQL
*
mysql
);
const
char
*
mysql_get_client_info
(
void
);
unsigned
long
mysql_get_client_version
(
void
);
const
char
*
mysql_get_host_info
(
MYSQL
*
mysql
);
...
...
@@ -520,6 +521,7 @@ void mysql_debug(const char *debug);
void
myodbc_remove_escape
(
MYSQL
*
mysql
,
char
*
name
);
unsigned
int
mysql_thread_safe
(
void
);
my_bool
mysql_embedded
(
void
);
my_bool
mariadb_connection
(
MYSQL
*
mysql
);
MYSQL_MANAGER
*
mysql_manager_init
(
MYSQL_MANAGER
*
con
);
MYSQL_MANAGER
*
mysql_manager_connect
(
MYSQL_MANAGER
*
con
,
const
char
*
host
,
...
...
libmysql/libmysql.c
View file @
3e052e0f
...
...
@@ -1430,6 +1430,18 @@ mysql_get_server_info(MYSQL *mysql)
}
my_bool
STDCALL
mariadb_connection
(
MYSQL
*
mysql
)
{
return
strinstr
(
mysql
->
server_version
,
"MariaDB"
)
!=
0
;
}
const
char
*
STDCALL
mysql_get_server_name
(
MYSQL
*
mysql
)
{
return
mariadb_connection
(
mysql
)
?
"MariaDB"
:
"MySQL"
;
}
const
char
*
STDCALL
mysql_get_host_info
(
MYSQL
*
mysql
)
{
...
...
mysql-test/r/mysqld_option_err.result
View file @
3e052e0f
...
...
@@ -3,4 +3,6 @@ Test bad binlog format.
Test bad default storage engine.
Test non-numeric value passed to number option.
Test that bad value for plugin enum option is rejected correctly.
Test that --help --verbose works
Test that --not-known-option --help --verbose gives error
Done.
mysql-test/t/mysqld_option_err.test
View file @
3e052e0f
...
...
@@ -46,5 +46,14 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--
error
7
--
exec
$MYSQLD
--
skip
-
networking
--
datadir
=
$MYSQLTEST_VARDIR
/
tmp
/
mysqld_option_err
--
skip
-
grant
-
tables
$EXAMPLE_PLUGIN_OPT
--
plugin
-
load
=
EXAMPLE
=
ha_example
.
so
--
plugin
-
example
-
enum
-
var
=
noexist
>>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld_option_err
/
mysqltest
.
log
2
>&
1
#
# Test that an wrong option with --help --verbose gives an error
#
--
echo
Test
that
--
help
--
verbose
works
--
exec
$MYSQLD
--
help
--
verbose
>>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld_option_err
/
mysqltest
.
log
2
>&
1
--
echo
Test
that
--
not
-
known
-
option
--
help
--
verbose
gives
error
--
error
2
--
exec
$MYSQLD
--
not
-
known
-
option
--
help
--
verbose
>>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld_option_err
/
mysqltest
.
log
2
>&
1
--
echo
Done
.
sql/mysqld.cc
View file @
3e052e0f
...
...
@@ -4020,9 +4020,6 @@ server.");
plugins_are_initialized
=
TRUE
;
/* Don't separate from init function */
}
if
(
opt_help
)
unireg_abort
(
0
);
/* we do want to exit if there are any other unknown options */
if
(
defaults_argc
>
1
)
{
...
...
@@ -4047,13 +4044,15 @@ server.");
if
(
defaults_argc
)
{
fprintf
(
stderr
,
"%s: Too many arguments (first extra is '%s').
\n
"
"Use --verbose --help to get a list of available options
\n
"
,
fprintf
(
stderr
,
"%s: Too many arguments (first extra is '%s').
\n
"
,
my_progname
,
*
tmp_argv
);
unireg_abort
(
1
);
}
}
if
(
opt_help
)
unireg_abort
(
0
);
/* if the errmsg.sys is not loaded, terminate to maintain behaviour */
if
(
!
errmesg
[
0
][
0
])
unireg_abort
(
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