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
3e2f0d16
Commit
3e2f0d16
authored
Sep 06, 2005
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.1
parents
9a7b8e10
0cf9ca58
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
118 additions
and
154 deletions
+118
-154
client/mysqltest.c
client/mysqltest.c
+100
-149
extra/Makefile.am
extra/Makefile.am
+1
-1
mysql-test/include/have_lowercase0.inc
mysql-test/include/have_lowercase0.inc
+2
-2
mysql-test/r/mysqltest.result
mysql-test/r/mysqltest.result
+1
-0
mysql-test/t/mysqltest.test
mysql-test/t/mysqltest.test
+3
-1
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/mysqld.cc
sql/mysqld.cc
+7
-0
sql/sql_parse.cc
sql/sql_parse.cc
+3
-1
No files found.
client/mysqltest.c
View file @
3e2f0d16
...
@@ -481,9 +481,10 @@ my_bool mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; }
...
@@ -481,9 +481,10 @@ my_bool mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; }
static
void
replace_dynstr_append_mem
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
,
static
void
replace_dynstr_append_mem
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
,
int
len
);
int
len
);
static
void
replace_dynstr_append
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
);
static
void
replace_dynstr_append
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
);
static
int
normal_handle_error
(
const
char
*
query
,
struct
st_query
*
q
,
static
int
handle_error
(
const
char
*
query
,
struct
st_query
*
q
,
MYSQL
*
mysql
,
DYNAMIC_STRING
*
ds
);
unsigned
int
err_errno
,
const
char
*
err_error
,
static
int
normal_handle_no_error
(
struct
st_query
*
q
);
const
char
*
err_sqlstate
,
DYNAMIC_STRING
*
ds
);
static
int
handle_no_error
(
struct
st_query
*
q
);
static
void
do_eval
(
DYNAMIC_STRING
*
query_eval
,
const
char
*
query
)
static
void
do_eval
(
DYNAMIC_STRING
*
query_eval
,
const
char
*
query
)
{
{
...
@@ -2071,11 +2072,12 @@ int connect_n_handle_errors(struct st_query *q, MYSQL* con, const char* host,
...
@@ -2071,11 +2072,12 @@ int connect_n_handle_errors(struct st_query *q, MYSQL* con, const char* host,
if
(
!
mysql_real_connect
(
con
,
host
,
user
,
pass
,
db
,
port
,
sock
?
sock
:
0
,
if
(
!
mysql_real_connect
(
con
,
host
,
user
,
pass
,
db
,
port
,
sock
?
sock
:
0
,
CLIENT_MULTI_STATEMENTS
))
CLIENT_MULTI_STATEMENTS
))
{
{
error
=
normal_handle_error
(
"connect"
,
q
,
con
,
ds
);
error
=
handle_error
(
"connect"
,
q
,
mysql_errno
(
con
),
mysql_error
(
con
),
mysql_sqlstate
(
con
),
ds
);
*
create_conn
=
0
;
*
create_conn
=
0
;
goto
err
;
goto
err
;
}
}
else
if
(
normal_
handle_no_error
(
q
))
else
if
(
handle_no_error
(
q
))
{
{
/*
/*
Fail if there was no error but we expected it.
Fail if there was no error but we expected it.
...
@@ -2964,8 +2966,6 @@ static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res)
...
@@ -2964,8 +2966,6 @@ static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res)
static
int
run_query_normal
(
MYSQL
*
mysql
,
struct
st_query
*
q
,
int
flags
);
static
int
run_query_normal
(
MYSQL
*
mysql
,
struct
st_query
*
q
,
int
flags
);
static
int
run_query_stmt
(
MYSQL
*
mysql
,
struct
st_query
*
q
,
int
flags
);
static
int
run_query_stmt
(
MYSQL
*
mysql
,
struct
st_query
*
q
,
int
flags
);
static
void
run_query_stmt_handle_warnings
(
MYSQL
*
mysql
,
DYNAMIC_STRING
*
ds
);
static
void
run_query_stmt_handle_warnings
(
MYSQL
*
mysql
,
DYNAMIC_STRING
*
ds
);
static
int
run_query_stmt_handle_error
(
char
*
query
,
struct
st_query
*
q
,
MYSQL_STMT
*
stmt
,
DYNAMIC_STRING
*
ds
);
static
void
run_query_display_metadata
(
MYSQL_FIELD
*
field
,
uint
num_fields
,
static
void
run_query_display_metadata
(
MYSQL_FIELD
*
field
,
uint
num_fields
,
DYNAMIC_STRING
*
ds
);
DYNAMIC_STRING
*
ds
);
...
@@ -3049,12 +3049,13 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags)
...
@@ -3049,12 +3049,13 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags)
(
!
(
last_result
=
res
=
mysql_store_result
(
mysql
))
&&
(
!
(
last_result
=
res
=
mysql_store_result
(
mysql
))
&&
mysql_field_count
(
mysql
)))
mysql_field_count
(
mysql
)))
{
{
if
(
normal_handle_error
(
query
,
q
,
mysql
,
ds
))
if
(
handle_error
(
query
,
q
,
mysql_errno
(
mysql
),
mysql_error
(
mysql
),
mysql_sqlstate
(
mysql
),
ds
))
error
=
1
;
error
=
1
;
goto
end
;
goto
end
;
}
}
if
(
normal_
handle_no_error
(
q
))
if
(
handle_no_error
(
q
))
{
{
error
=
1
;
error
=
1
;
goto
end
;
goto
end
;
...
@@ -3169,14 +3170,15 @@ end:
...
@@ -3169,14 +3170,15 @@ end:
/*
/*
Handle errors which occurred after execution of conventional (non-prepared)
Handle errors which occurred after execution
statement.
SYNOPSIS
SYNOPSIS
normal_
handle_error()
handle_error()
query - query string
query - query string
q - query context
q - query context
mysql - connection through which query was sent to server
err_errno - error number
err_error - error message
err_sqlstate - sql state
ds - dynamic string which is used for output buffer
ds - dynamic string which is used for output buffer
NOTE
NOTE
...
@@ -3188,35 +3190,35 @@ end:
...
@@ -3188,35 +3190,35 @@ end:
1 - Some other error was expected.
1 - Some other error was expected.
*/
*/
static
int
normal_handle_error
(
const
char
*
query
,
struct
st_query
*
q
,
static
int
handle_error
(
const
char
*
query
,
struct
st_query
*
q
,
MYSQL
*
mysql
,
DYNAMIC_STRING
*
ds
)
unsigned
int
err_errno
,
const
char
*
err_error
,
const
char
*
err_sqlstate
,
DYNAMIC_STRING
*
ds
)
{
{
uint
i
;
uint
i
;
DBUG_ENTER
(
"
normal_
handle_error"
);
DBUG_ENTER
(
"handle_error"
);
if
(
q
->
require_file
)
if
(
q
->
require_file
)
abort_not_supported_test
();
abort_not_supported_test
();
if
(
q
->
abort_on_error
)
if
(
q
->
abort_on_error
)
die
(
"query '%s' failed: %d: %s"
,
query
,
die
(
"query '%s' failed: %d: %s"
,
query
,
mysql_errno
(
mysql
),
mysql_error
(
mysql
));
err_errno
,
err_error
);
else
{
for
(
i
=
0
;
(
uint
)
i
<
q
->
expected_errors
;
i
++
)
for
(
i
=
0
;
(
uint
)
i
<
q
->
expected_errors
;
i
++
)
{
{
if
(((
q
->
expected_errno
[
i
].
type
==
ERR_ERRNO
)
&&
if
(((
q
->
expected_errno
[
i
].
type
==
ERR_ERRNO
)
&&
(
q
->
expected_errno
[
i
].
code
.
errnum
==
mysql_errno
(
mysql
)
))
||
(
q
->
expected_errno
[
i
].
code
.
errnum
==
err_errno
))
||
((
q
->
expected_errno
[
i
].
type
==
ERR_SQLSTATE
)
&&
((
q
->
expected_errno
[
i
].
type
==
ERR_SQLSTATE
)
&&
(
strcmp
(
q
->
expected_errno
[
i
].
code
.
sqlstate
,
mysql_sqlstate
(
mysql
)
)
==
0
)))
(
strcmp
(
q
->
expected_errno
[
i
].
code
.
sqlstate
,
err_sqlstate
)
==
0
)))
{
{
if
(
q
->
expected_errors
==
1
)
if
(
q
->
expected_errors
==
1
)
{
{
/* Only log error if there is one possible error */
/* Only log error if there is one possible error */
dynstr_append_mem
(
ds
,
"ERROR "
,
6
);
dynstr_append_mem
(
ds
,
"ERROR "
,
6
);
replace_dynstr_append
(
ds
,
mysql_sqlstate
(
mysql
)
);
replace_dynstr_append
(
ds
,
err_sqlstate
);
dynstr_append_mem
(
ds
,
": "
,
2
);
dynstr_append_mem
(
ds
,
": "
,
2
);
replace_dynstr_append
(
ds
,
mysql_error
(
mysql
)
);
replace_dynstr_append
(
ds
,
err_error
);
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
}
}
/* Don't log error if we may not get an error */
/* Don't log error if we may not get an error */
...
@@ -3232,20 +3234,20 @@ static int normal_handle_error(const char *query, struct st_query *q,
...
@@ -3232,20 +3234,20 @@ static int normal_handle_error(const char *query, struct st_query *q,
DBUG_PRINT
(
"info"
,(
"i: %d expected_errors: %d"
,
i
,
q
->
expected_errors
));
DBUG_PRINT
(
"info"
,(
"i: %d expected_errors: %d"
,
i
,
q
->
expected_errors
));
dynstr_append_mem
(
ds
,
"ERROR "
,
6
);
dynstr_append_mem
(
ds
,
"ERROR "
,
6
);
replace_dynstr_append
(
ds
,
mysql_sqlstate
(
mysql
)
);
replace_dynstr_append
(
ds
,
err_sqlstate
);
dynstr_append_mem
(
ds
,
": "
,
2
);
dynstr_append_mem
(
ds
,
": "
,
2
);
replace_dynstr_append
(
ds
,
mysql_error
(
mysql
)
);
replace_dynstr_append
(
ds
,
err_error
);
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
if
(
i
)
if
(
i
)
{
{
if
(
q
->
expected_errno
[
0
].
type
==
ERR_ERRNO
)
if
(
q
->
expected_errno
[
0
].
type
==
ERR_ERRNO
)
verbose_msg
(
"query '%s' failed with wrong errno %d instead of %d..."
,
verbose_msg
(
"query '%s' failed with wrong errno %d instead of %d..."
,
q
->
query
,
mysql_errno
(
mysql
)
,
q
->
query
,
err_errno
,
q
->
expected_errno
[
0
].
code
.
errnum
);
q
->
expected_errno
[
0
].
code
.
errnum
);
else
else
verbose_msg
(
"query '%s' failed with wrong sqlstate %s instead of %s..."
,
verbose_msg
(
"query '%s' failed with wrong sqlstate %s instead of %s..."
,
q
->
query
,
mysql_sqlstate
(
mysql
)
,
q
->
query
,
err_sqlstate
,
q
->
expected_errno
[
0
].
code
.
sqlstate
);
q
->
expected_errno
[
0
].
code
.
sqlstate
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
...
@@ -3254,19 +3256,17 @@ static int normal_handle_error(const char *query, struct st_query *q,
...
@@ -3254,19 +3256,17 @@ static int normal_handle_error(const char *query, struct st_query *q,
If we do not abort on error, failure to run the query does not fail the
If we do not abort on error, failure to run the query does not fail the
whole test case.
whole test case.
*/
*/
verbose_msg
(
"query '%s' failed: %d: %s"
,
q
->
query
,
mysql_errno
(
mysql
)
,
verbose_msg
(
"query '%s' failed: %d: %s"
,
q
->
query
,
err_errno
,
mysql_error
(
mysql
)
);
err_error
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
return
0
;
/* Keep compiler happy */
}
}
/*
/*
Handle absence of errors after execution
of convetional statement.
Handle absence of errors after execution
SYNOPSIS
SYNOPSIS
normal_handle
_error()
handle_no
_error()
q - context of query
q - context of query
RETURN VALUE
RETURN VALUE
...
@@ -3274,9 +3274,9 @@ static int normal_handle_error(const char *query, struct st_query *q,
...
@@ -3274,9 +3274,9 @@ static int normal_handle_error(const char *query, struct st_query *q,
1 - Some error was expected from this query.
1 - Some error was expected from this query.
*/
*/
static
int
normal_
handle_no_error
(
struct
st_query
*
q
)
static
int
handle_no_error
(
struct
st_query
*
q
)
{
{
DBUG_ENTER
(
"
normal_
handle_no_error"
);
DBUG_ENTER
(
"handle_no_error"
);
if
(
q
->
expected_errno
[
0
].
type
==
ERR_ERRNO
&&
if
(
q
->
expected_errno
[
0
].
type
==
ERR_ERRNO
&&
q
->
expected_errno
[
0
].
code
.
errnum
!=
0
)
q
->
expected_errno
[
0
].
code
.
errnum
!=
0
)
...
@@ -3370,17 +3370,17 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags)
...
@@ -3370,17 +3370,17 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags)
{
{
if
(
q
->
abort_on_error
)
if
(
q
->
abort_on_error
)
{
{
die
(
"unable to prepare statement '%s': "
die
(
"query '%s' failed: %d: %s"
,
query
,
"%s (mysql_stmt_errno=%d returned=%d)"
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
));
query
,
mysql_stmt_error
(
stmt
),
mysql_stmt_errno
(
stmt
),
err
);
}
}
else
else
{
{
/*
/*
Preparing is part of normal execution and some errors may be expected
Preparing is part of normal execution and some errors may be expected
*/
*/
error
=
run_query_stmt_handle_error
(
query
,
q
,
stmt
,
ds
);
error
=
handle_error
(
query
,
q
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
),
mysql_stmt_sqlstate
(
stmt
),
ds
);
goto
end
;
goto
end
;
}
}
}
}
...
@@ -3413,7 +3413,9 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags)
...
@@ -3413,7 +3413,9 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags)
else
else
{
{
/* We got an error, maybe expected */
/* We got an error, maybe expected */
error
=
run_query_stmt_handle_error
(
query
,
q
,
stmt
,
ds
);
error
=
handle_error
(
query
,
q
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
),
mysql_stmt_sqlstate
(
stmt
),
ds
);
goto
end
;
goto
end
;
}
}
}
}
...
@@ -3449,18 +3451,16 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags)
...
@@ -3449,18 +3451,16 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags)
else
else
{
{
/* We got an error, maybe expected */
/* We got an error, maybe expected */
error
=
run_query_stmt_handle_error
(
query
,
q
,
stmt
,
ds
);
error
=
handle_error
(
query
,
q
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
),
mysql_stmt_sqlstate
(
stmt
),
ds
);
goto
end
;
goto
end
;
}
}
}
}
/* If we got here the statement was both executed and read succeesfully */
/* If we got here the statement was both executed and read succeesfully */
if
(
handle_no_error
(
q
))
if
(
q
->
expected_errno
[
0
].
type
==
ERR_ERRNO
&&
q
->
expected_errno
[
0
].
code
.
errnum
!=
0
)
{
{
verbose_msg
(
"query '%s' succeeded - should have failed with errno %d..."
,
q
->
query
,
q
->
expected_errno
[
0
].
code
.
errnum
);
error
=
1
;
error
=
1
;
goto
end
;
goto
end
;
}
}
...
@@ -3740,71 +3740,6 @@ static void run_query_stmt_handle_warnings(MYSQL *mysql, DYNAMIC_STRING *ds)
...
@@ -3740,71 +3740,6 @@ static void run_query_stmt_handle_warnings(MYSQL *mysql, DYNAMIC_STRING *ds)
}
}
static
int
run_query_stmt_handle_error
(
char
*
query
,
struct
st_query
*
q
,
MYSQL_STMT
*
stmt
,
DYNAMIC_STRING
*
ds
)
{
if
(
q
->
require_file
)
/* FIXME don't understand this one */
{
abort_not_supported_test
();
}
if
(
q
->
abort_on_error
)
die
(
"query '%s' failed: %d: %s"
,
query
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
));
else
{
int
i
;
for
(
i
=
0
;
(
uint
)
i
<
q
->
expected_errors
;
i
++
)
{
if
(((
q
->
expected_errno
[
i
].
type
==
ERR_ERRNO
)
&&
(
q
->
expected_errno
[
i
].
code
.
errnum
==
mysql_stmt_errno
(
stmt
)))
||
((
q
->
expected_errno
[
i
].
type
==
ERR_SQLSTATE
)
&&
(
strcmp
(
q
->
expected_errno
[
i
].
code
.
sqlstate
,
mysql_stmt_sqlstate
(
stmt
))
==
0
)))
{
if
(
i
==
0
&&
q
->
expected_errors
==
1
)
{
/* Only log error if there is one possible error */
dynstr_append_mem
(
ds
,
"ERROR "
,
6
);
replace_dynstr_append
(
ds
,
mysql_stmt_sqlstate
(
stmt
));
dynstr_append_mem
(
ds
,
": "
,
2
);
replace_dynstr_append
(
ds
,
mysql_stmt_error
(
stmt
));
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
}
/* Don't log error if we may not get an error */
else
if
(
q
->
expected_errno
[
0
].
type
==
ERR_SQLSTATE
||
(
q
->
expected_errno
[
0
].
type
==
ERR_ERRNO
&&
q
->
expected_errno
[
0
].
code
.
errnum
!=
0
))
dynstr_append
(
ds
,
"Got one of the listed errors
\n
"
);
return
0
;
/* Ok */
}
}
DBUG_PRINT
(
"info"
,(
"i: %d expected_errors: %d"
,
i
,
q
->
expected_errors
));
dynstr_append_mem
(
ds
,
"ERROR "
,
6
);
replace_dynstr_append
(
ds
,
mysql_stmt_sqlstate
(
stmt
));
dynstr_append_mem
(
ds
,
": "
,
2
);
replace_dynstr_append
(
ds
,
mysql_stmt_error
(
stmt
));
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
if
(
i
)
{
verbose_msg
(
"query '%s' failed with wrong errno %d instead of %d..."
,
q
->
query
,
mysql_stmt_errno
(
stmt
),
q
->
expected_errno
[
0
]);
return
1
;
/* Error */
}
verbose_msg
(
"query '%s' failed: %d: %s"
,
q
->
query
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
));
/*
if we do not abort on error, failure to run the query does
not fail the whole test case
*/
return
0
;
}
return
0
;
}
/****************************************************************************\
/****************************************************************************\
* Functions to match SQL statements that can be prepared
* Functions to match SQL statements that can be prepared
\****************************************************************************/
\****************************************************************************/
...
@@ -3901,6 +3836,22 @@ void get_query_type(struct st_query* q)
...
@@ -3901,6 +3836,22 @@ void get_query_type(struct st_query* q)
q
->
type
!=
Q_DISABLE_PARSING
)
q
->
type
!=
Q_DISABLE_PARSING
)
q
->
type
=
Q_COMMENT
;
q
->
type
=
Q_COMMENT
;
}
}
else
if
(
q
->
type
==
Q_COMMENT_WITH_COMMAND
&&
q
->
query
[
q
->
first_word_len
-
1
]
==
';'
)
{
/*
Detect comment with command using extra delimiter
Ex --disable_query_log;
^ Extra delimiter causing the command
to be skipped
*/
save
=
q
->
query
[
q
->
first_word_len
-
1
];
q
->
query
[
q
->
first_word_len
-
1
]
=
0
;
type
=
find_type
(
q
->
query
,
&
command_typelib
,
1
+
2
);
q
->
query
[
q
->
first_word_len
-
1
]
=
save
;
if
(
type
>
0
)
die
(
"Extra delimiter
\"
;
\"
found"
);
}
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
extra/Makefile.am
View file @
3e2f0d16
...
@@ -38,7 +38,7 @@ $(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h
...
@@ -38,7 +38,7 @@ $(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h
$(top_builddir)/include/sql_state.h
:
$(top_builddir)/include/mysqld_error.h
$(top_builddir)/include/sql_state.h
:
$(top_builddir)/include/mysqld_error.h
bin_PROGRAMS
=
replace comp_err perror resolveip my_print_defaults
\
bin_PROGRAMS
=
replace comp_err perror resolveip my_print_defaults
\
resolve_stack_dump mysql_waitpid innochecksum
resolve_stack_dump mysql_waitpid
#
innochecksum
noinst_PROGRAMS
=
charset2html
noinst_PROGRAMS
=
charset2html
# Don't update the files from bitkeeper
# Don't update the files from bitkeeper
...
...
mysql-test/include/have_lowercase0.inc
View file @
3e2f0d16
--
require
r
/
lowercase0
.
require
--
require
r
/
lowercase0
.
require
--
disable_query_log
;
--
disable_query_log
show
variables
like
"lower_case_%"
;
show
variables
like
"lower_case_%"
;
--
enable_query_log
;
--
enable_query_log
mysql-test/r/mysqltest.result
View file @
3e2f0d16
...
@@ -152,6 +152,7 @@ mysqltest: At line 1: End of line junk detected: "6"
...
@@ -152,6 +152,7 @@ mysqltest: At line 1: End of line junk detected: "6"
mysqltest: At line 1: End of line junk detected: "6"
mysqltest: At line 1: End of line junk detected: "6"
mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: Extra delimiter ";" found
mysqltest: At line 1: Extra delimiter ";" found
mysqltest: At line 1: Extra delimiter ";" found
MySQL
MySQL
"MySQL"
"MySQL"
MySQL: The world''s most popular open source database
MySQL: The world''s most popular open source database
...
...
mysql-test/t/mysqltest.test
View file @
3e2f0d16
...
@@ -369,6 +369,8 @@ select 3 from t1 ;
...
@@ -369,6 +369,8 @@ select 3 from t1 ;
#
#
--
error
1
--
error
1
--
exec
echo
"--sleep 4;"
|
$MYSQL_TEST
2
>&
1
--
exec
echo
"--sleep 4;"
|
$MYSQL_TEST
2
>&
1
--
error
1
--
exec
echo
"--disable_query_log;"
|
$MYSQL_TEST
2
>&
1
# Allow trailing # comment
# Allow trailing # comment
...
@@ -592,7 +594,7 @@ while ($num)
...
@@ -592,7 +594,7 @@ while ($num)
--
source
var
/
tmp
/
sourced1
.
sql
--
source
var
/
tmp
/
sourced1
.
sql
dec
$num
;
dec
$num
;
}
}
--
enable_abort_on_error
;
--
enable_abort_on_error
--
enable_query_log
--
enable_query_log
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
...
...
sql/mysql_priv.h
View file @
3e2f0d16
...
@@ -1175,6 +1175,7 @@ extern bool opt_using_transactions, mysqld_embedded;
...
@@ -1175,6 +1175,7 @@ extern bool opt_using_transactions, mysqld_embedded;
extern
bool
using_update_log
,
opt_large_files
,
server_id_supplied
;
extern
bool
using_update_log
,
opt_large_files
,
server_id_supplied
;
extern
bool
opt_log
,
opt_update_log
,
opt_bin_log
,
opt_slow_log
,
opt_error_log
;
extern
bool
opt_log
,
opt_update_log
,
opt_bin_log
,
opt_slow_log
,
opt_error_log
;
extern
bool
opt_disable_networking
,
opt_skip_show_db
;
extern
bool
opt_disable_networking
,
opt_skip_show_db
;
extern
bool
opt_character_set_client_handshake
;
extern
bool
volatile
abort_loop
,
shutdown_in_progress
,
grant_option
;
extern
bool
volatile
abort_loop
,
shutdown_in_progress
,
grant_option
;
extern
bool
mysql_proc_table_exists
;
extern
bool
mysql_proc_table_exists
;
extern
uint
volatile
thread_count
,
thread_running
,
global_read_lock
;
extern
uint
volatile
thread_count
,
thread_running
,
global_read_lock
;
...
...
sql/mysqld.cc
View file @
3e2f0d16
...
@@ -339,6 +339,7 @@ static my_bool opt_sync_bdb_logs;
...
@@ -339,6 +339,7 @@ static my_bool opt_sync_bdb_logs;
bool
opt_log
,
opt_update_log
,
opt_bin_log
,
opt_slow_log
;
bool
opt_log
,
opt_update_log
,
opt_bin_log
,
opt_slow_log
;
bool
opt_error_log
=
IF_WIN
(
1
,
0
);
bool
opt_error_log
=
IF_WIN
(
1
,
0
);
bool
opt_disable_networking
=
0
,
opt_skip_show_db
=
0
;
bool
opt_disable_networking
=
0
,
opt_skip_show_db
=
0
;
bool
opt_character_set_client_handshake
=
1
;
bool
server_id_supplied
=
0
;
bool
server_id_supplied
=
0
;
bool
opt_endinfo
,
using_udf_functions
,
locked_in_memory
;
bool
opt_endinfo
,
using_udf_functions
,
locked_in_memory
;
bool
opt_using_transactions
,
using_update_log
;
bool
opt_using_transactions
,
using_update_log
;
...
@@ -4423,6 +4424,7 @@ enum options_mysqld
...
@@ -4423,6 +4424,7 @@ enum options_mysqld
OPT_EXPIRE_LOGS_DAYS
,
OPT_EXPIRE_LOGS_DAYS
,
OPT_GROUP_CONCAT_MAX_LEN
,
OPT_GROUP_CONCAT_MAX_LEN
,
OPT_DEFAULT_COLLATION
,
OPT_DEFAULT_COLLATION
,
OPT_CHARACTER_SET_CLIENT_HANDSHAKE
,
OPT_INIT_CONNECT
,
OPT_INIT_CONNECT
,
OPT_INIT_SLAVE
,
OPT_INIT_SLAVE
,
OPT_SECURE_AUTH
,
OPT_SECURE_AUTH
,
...
@@ -4524,6 +4526,11 @@ Disable with --skip-bdb (will save memory).",
...
@@ -4524,6 +4526,11 @@ Disable with --skip-bdb (will save memory).",
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"bootstrap"
,
OPT_BOOTSTRAP
,
"Used by mysql installation scripts."
,
0
,
0
,
0
,
{
"bootstrap"
,
OPT_BOOTSTRAP
,
"Used by mysql installation scripts."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"character-set-client-handshake"
,
OPT_CHARACTER_SET_CLIENT_HANDSHAKE
,
"Don't use client side character set value sent during handshake."
,
(
gptr
*
)
&
opt_character_set_client_handshake
,
(
gptr
*
)
&
opt_character_set_client_handshake
,
0
,
GET_BOOL
,
NO_ARG
,
1
,
0
,
0
,
0
,
0
,
0
},
{
"character-set-server"
,
'C'
,
"Set the default character set."
,
{
"character-set-server"
,
'C'
,
"Set the default character set."
,
(
gptr
*
)
&
default_character_set_name
,
(
gptr
*
)
&
default_character_set_name
,
(
gptr
*
)
&
default_character_set_name
,
(
gptr
*
)
&
default_character_set_name
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
sql/sql_parse.cc
View file @
3e2f0d16
...
@@ -879,11 +879,13 @@ static int check_connection(THD *thd)
...
@@ -879,11 +879,13 @@ static int check_connection(THD *thd)
DBUG_PRINT
(
"info"
,
(
"client_character_set: %d"
,
(
uint
)
net
->
read_pos
[
8
]));
DBUG_PRINT
(
"info"
,
(
"client_character_set: %d"
,
(
uint
)
net
->
read_pos
[
8
]));
/*
/*
Use server character set and collation if
Use server character set and collation if
- opt_character_set_client_handshake is not set
- client has not specified a character set
- client has not specified a character set
- client character set is the same as the servers
- client character set is the same as the servers
- client character set doesn't exists in server
- client character set doesn't exists in server
*/
*/
if
(
!
(
thd
->
variables
.
character_set_client
=
if
(
!
opt_character_set_client_handshake
||
!
(
thd
->
variables
.
character_set_client
=
get_charset
((
uint
)
net
->
read_pos
[
8
],
MYF
(
0
)))
||
get_charset
((
uint
)
net
->
read_pos
[
8
],
MYF
(
0
)))
||
!
my_strcasecmp
(
&
my_charset_latin1
,
!
my_strcasecmp
(
&
my_charset_latin1
,
global_system_variables
.
character_set_client
->
name
,
global_system_variables
.
character_set_client
->
name
,
...
...
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