mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
This commit is contained in:
commit
0abaf88c89
79 changed files with 1519 additions and 330 deletions
|
@ -44,8 +44,8 @@ set -e
|
|||
export AM_MAKEFLAGS
|
||||
AM_MAKEFLAGS="-j 4"
|
||||
|
||||
# SSL library to use. Should be changed to --with-yassl
|
||||
SSL_LIBRARY=--with-openssl
|
||||
# SSL library to use.
|
||||
SSL_LIBRARY=--with-yassl
|
||||
|
||||
# If you are not using codefusion add "-Wpointer-arith" to WARNINGS
|
||||
# The following warning flag will give too many warnings:
|
||||
|
|
|
@ -373,8 +373,10 @@ const char *command_names[]=
|
|||
"enable_rpl_parse",
|
||||
"disable_rpl_parse",
|
||||
"eval_result",
|
||||
/* Enable/disable that the _query_ is logged to result file */
|
||||
"enable_query_log",
|
||||
"disable_query_log",
|
||||
/* Enable/disable that the _result_ from a query is logged to result file */
|
||||
"enable_result_log",
|
||||
"disable_result_log",
|
||||
"server_start",
|
||||
|
@ -425,6 +427,7 @@ static VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
|
|||
static void var_free(void* v);
|
||||
|
||||
void dump_result_to_reject_file(const char *record_file, char *buf, int size);
|
||||
void dump_result_to_log_file(const char *record_file, char *buf, int size);
|
||||
|
||||
int close_connection(struct st_query*);
|
||||
static void set_charset(struct st_query*);
|
||||
|
@ -615,6 +618,8 @@ static void die(const char *fmt, ...)
|
|||
{
|
||||
va_list args;
|
||||
DBUG_ENTER("die");
|
||||
|
||||
/* Print the error message */
|
||||
va_start(args, fmt);
|
||||
if (fmt)
|
||||
{
|
||||
|
@ -629,6 +634,12 @@ static void die(const char *fmt, ...)
|
|||
fflush(stderr);
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
/* Dump the result that has been accumulated so far to .log file */
|
||||
if (result_file && ds_res.length)
|
||||
dump_result_to_log_file(result_file, ds_res.str, ds_res.length);
|
||||
|
||||
/* Clean up and exit */
|
||||
free_used_memory();
|
||||
my_end(MY_CHECK_ERROR);
|
||||
|
||||
|
@ -752,8 +763,8 @@ err:
|
|||
check_result
|
||||
ds - content to be checked
|
||||
fname - name of file to check against
|
||||
require_option - if set and check fails, the test will be aborted with the special
|
||||
exit code "not supported test"
|
||||
require_option - if set and check fails, the test will be aborted
|
||||
with the special exit code "not supported test"
|
||||
|
||||
RETURN VALUES
|
||||
error - the function will not return
|
||||
|
@ -3129,6 +3140,12 @@ void dump_result_to_reject_file(const char *record_file, char *buf, int size)
|
|||
str_to_file(fn_format(reject_file, record_file,"",".reject",2), buf, size);
|
||||
}
|
||||
|
||||
void dump_result_to_log_file(const char *record_file, char *buf, int size)
|
||||
{
|
||||
char log_file[FN_REFLEN];
|
||||
str_to_file(fn_format(log_file, record_file,"",".log",2), buf, size);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __WIN__
|
||||
|
||||
|
@ -3708,7 +3725,17 @@ static void handle_error(const char *query, struct st_query *q,
|
|||
DBUG_ENTER("handle_error");
|
||||
|
||||
if (q->require_file)
|
||||
{
|
||||
/*
|
||||
The query after a "--require" failed. This is fine as long the server
|
||||
returned a valid reponse. Don't allow 2013 or 2006 to trigger an
|
||||
abort_not_supported_test
|
||||
*/
|
||||
if (err_errno == CR_SERVER_LOST ||
|
||||
err_errno == CR_SERVER_GONE_ERROR)
|
||||
die("require query '%s' failed: %d: %s", query, err_errno, err_error);
|
||||
abort_not_supported_test();
|
||||
}
|
||||
|
||||
if (q->abort_on_error)
|
||||
die("query '%s' failed: %d: %s", query, err_errno, err_error);
|
||||
|
|
44
configure.in
44
configure.in
|
@ -1547,16 +1547,37 @@ else
|
|||
fi
|
||||
#---END:
|
||||
|
||||
# Check for dlopen, needed for user definable functions
|
||||
# This must be checked after threads on AIX
|
||||
# We only need this for mysqld, not for the clients.
|
||||
# dlopen, dlerror
|
||||
case "$with_mysqld_ldflags " in
|
||||
|
||||
*"-static "*)
|
||||
# No need to check for dlopen when mysqld is linked with
|
||||
# -all-static or -static as it won't be able to load any functions.
|
||||
# NOTE! It would be better if it was possible to test if dlopen
|
||||
# can be used, but a good way to test it couldn't be found
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
# Check for dlopen, needed for user definable functions
|
||||
# This must be checked after threads on AIX
|
||||
# We only need this for mysqld, not for the clients.
|
||||
|
||||
my_save_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_CHECK_LIB(dl,dlopen)
|
||||
LIBDL=$LIBS
|
||||
LIBS="$my_save_LIBS"
|
||||
AC_SUBST(LIBDL)
|
||||
|
||||
my_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBDL"
|
||||
AC_CHECK_FUNCS(dlopen dlerror)
|
||||
LIBS="$my_save_LIBS"
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
my_save_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_CHECK_LIB(dl,dlopen)
|
||||
LIBDL=$LIBS
|
||||
LIBS="$my_save_LIBS"
|
||||
AC_SUBST(LIBDL)
|
||||
|
||||
# System characteristics
|
||||
case $SYSTEM_TYPE in
|
||||
|
@ -1925,11 +1946,6 @@ then
|
|||
fi]
|
||||
)
|
||||
|
||||
my_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBDL"
|
||||
AC_CHECK_FUNCS(dlopen dlerror)
|
||||
LIBS="$my_save_LIBS"
|
||||
|
||||
# Check definition of gethostbyaddr_r (glibc2 defines this with 8 arguments)
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
|
||||
|
|
|
@ -407,8 +407,15 @@ inline double ulonglong2double(ulonglong value)
|
|||
|
||||
#define shared_memory_buffer_length 16000
|
||||
#define default_shared_memory_base_name "MYSQL"
|
||||
|
||||
#ifdef CYBOZU
|
||||
#define MYSQL_DEFAULT_CHARSET_NAME "utf8"
|
||||
#define MYSQL_DEFAULT_COLLATION_NAME "utf8_general_cs"
|
||||
#define HAVE_UTF8_GENERAL_CS 1
|
||||
#else
|
||||
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
|
||||
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
|
||||
#endif
|
||||
|
||||
#define HAVE_SPATIAL 1
|
||||
#define HAVE_RTREE_KEYS 1
|
||||
|
@ -419,8 +426,10 @@ inline double ulonglong2double(ulonglong value)
|
|||
/* Define charsets you want */
|
||||
/* #undef HAVE_CHARSET_armscii8 */
|
||||
/* #undef HAVE_CHARSET_ascii */
|
||||
#ifndef CYBOZU
|
||||
#define HAVE_CHARSET_big5 1
|
||||
#define HAVE_CHARSET_cp1250 1
|
||||
#endif
|
||||
/* #undef HAVE_CHARSET_cp1251 */
|
||||
/* #undef HAVE_CHARSET_cp1256 */
|
||||
/* #undef HAVE_CHARSET_cp1257 */
|
||||
|
@ -429,27 +438,33 @@ inline double ulonglong2double(ulonglong value)
|
|||
/* #undef HAVE_CHARSET_cp866 */
|
||||
#define HAVE_CHARSET_cp932 1
|
||||
/* #undef HAVE_CHARSET_dec8 */
|
||||
#ifndef CYBOZU
|
||||
#define HAVE_CHARSET_eucjpms 1
|
||||
#define HAVE_CHARSET_euckr 1
|
||||
#define HAVE_CHARSET_gb2312 1
|
||||
#define HAVE_CHARSET_gbk 1
|
||||
#endif
|
||||
/* #undef HAVE_CHARSET_greek */
|
||||
/* #undef HAVE_CHARSET_hebrew */
|
||||
/* #undef HAVE_CHARSET_hp8 */
|
||||
/* #undef HAVE_CHARSET_keybcs2 */
|
||||
/* #undef HAVE_CHARSET_koi8r */
|
||||
/* #undef HAVE_CHARSET_koi8u */
|
||||
#ifndef CYBOZU
|
||||
#define HAVE_CHARSET_latin1 1
|
||||
#define HAVE_CHARSET_latin2 1
|
||||
#endif
|
||||
/* #undef HAVE_CHARSET_latin5 */
|
||||
/* #undef HAVE_CHARSET_latin7 */
|
||||
/* #undef HAVE_CHARSET_macce */
|
||||
/* #undef HAVE_CHARSET_macroman */
|
||||
#define HAVE_CHARSET_sjis 1
|
||||
/* #undef HAVE_CHARSET_swe7 */
|
||||
#ifndef CYBOZU
|
||||
#define HAVE_CHARSET_tis620 1
|
||||
#define HAVE_CHARSET_ucs2 1
|
||||
#define HAVE_CHARSET_ujis 1
|
||||
#endif
|
||||
#define HAVE_CHARSET_utf8 1
|
||||
#define HAVE_UCA_COLLATIONS 1
|
||||
|
||||
|
|
|
@ -44,13 +44,23 @@ typedef struct unicase_info_st
|
|||
uint16 sort;
|
||||
} MY_UNICASE_INFO;
|
||||
|
||||
|
||||
extern MY_UNICASE_INFO *my_unicase_default[256];
|
||||
extern MY_UNICASE_INFO *my_unicase_turkish[256];
|
||||
|
||||
#define MY_CS_ILSEQ 0
|
||||
#define MY_CS_ILUNI 0
|
||||
#define MY_CS_TOOSMALL -1
|
||||
#define MY_CS_TOOFEW(n) (-1-(n))
|
||||
|
||||
/* wm_wc and wc_mb return codes */
|
||||
#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */
|
||||
#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */
|
||||
#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */
|
||||
#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */
|
||||
#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */
|
||||
/* These following three are currently not really used */
|
||||
#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */
|
||||
#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */
|
||||
#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */
|
||||
/* A helper macros for "need at least n bytes" */
|
||||
#define MY_CS_TOOSMALLN(n) (-100-(n))
|
||||
|
||||
#define MY_SEQ_INTTAIL 1
|
||||
#define MY_SEQ_SPACES 2
|
||||
|
@ -360,6 +370,11 @@ int my_wildcmp_8bit(CHARSET_INFO *,
|
|||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
|
||||
int my_wildcmp_bin(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
|
||||
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
|
|
4
mysql-test/include/have_latin2_ch.inc
Normal file
4
mysql-test/include/have_latin2_ch.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
-- require r/have_latin2_ch.require
|
||||
disable_query_log;
|
||||
show collation like "latin2_czech_cs";
|
||||
enable_query_log;
|
12
mysql-test/include/have_udf.inc
Normal file
12
mysql-test/include/have_udf.inc
Normal file
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# To check if the udf_example.so is available,
|
||||
# try to load one function from it.
|
||||
#
|
||||
#
|
||||
--require r/have_udf.require
|
||||
--disable_abort_on_error
|
||||
CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
|
||||
--disable_query_log
|
||||
DROP FUNCTION metaphon;
|
||||
--enable_query_log
|
||||
--enable_abort_on_error
|
158
mysql-test/include/wait_slave_status.inc
Normal file
158
mysql-test/include/wait_slave_status.inc
Normal file
|
@ -0,0 +1,158 @@
|
|||
# include/wait_slave_status.inc
|
||||
#
|
||||
# Created by Matthias Leich
|
||||
#
|
||||
# SUMMARY
|
||||
#
|
||||
# Waits until slave has reached certain state or maximum time reached.
|
||||
#
|
||||
# (This script will not work, when the SHOW command delivers more than one
|
||||
# result record, because only the first record will be caught.)
|
||||
#
|
||||
# USAGE
|
||||
#
|
||||
# Set $result_pattern in test file and source this file:
|
||||
#
|
||||
# let $result_pattern= <pattern used for LIKE on the result of
|
||||
# SHOW STATUS SLAVE>
|
||||
# --include wait_slave_status.inc
|
||||
#
|
||||
# EXAMPLE
|
||||
#
|
||||
# The script rpl_until.test:
|
||||
# ...
|
||||
# --replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
# --replace_column 1 # 9 # 23 # 33 #
|
||||
# --vertical_results show slave status;
|
||||
#
|
||||
# outputs
|
||||
# show slave status;
|
||||
# Slave_IO_State #
|
||||
# Master_Host 127.0.0.1
|
||||
# Master_User root
|
||||
# Master_Port MASTER_MYPORT
|
||||
# Connect_Retry 1
|
||||
# Master_Log_File master-bin.000001
|
||||
# Read_Master_Log_Pos 776
|
||||
# Relay_Log_File slave-relay-bin.000004
|
||||
# Relay_Log_Pos #
|
||||
# Relay_Master_Log_File master-bin.000001
|
||||
# Slave_IO_Running Yes
|
||||
# Slave_SQL_Running No
|
||||
# Replicate_Do_DB
|
||||
# Replicate_Ignore_DB
|
||||
# Replicate_Do_Table
|
||||
# Replicate_Ignore_Table
|
||||
# Replicate_Wild_Do_Table
|
||||
# Replicate_Wild_Ignore_Table
|
||||
# Last_Errno 0
|
||||
# Last_Error
|
||||
# Skip_Counter 0
|
||||
# Exec_Master_Log_Pos 319
|
||||
# Relay_Log_Space #
|
||||
# Until_Condition Master
|
||||
# Until_Log_File master-bin.000001
|
||||
# Until_Log_Pos 319
|
||||
# Master_SSL_Allowed No
|
||||
# Master_SSL_CA_File
|
||||
# Master_SSL_CA_Path
|
||||
# Master_SSL_Cert
|
||||
# Master_SSL_Cipher
|
||||
# Master_SSL_Key
|
||||
# Seconds_Behind_Master #
|
||||
#
|
||||
# The main problem with the "show slave status;" in rpl_until is, that
|
||||
# depending on the total test engine power and the current load caused by
|
||||
# other processes, the expected slave status might be not reached though
|
||||
# it will happen in maybe some seconds.
|
||||
#
|
||||
# The typical problem with rpl_until is that Slave_IO_Running is "No"
|
||||
# instead of "Yes".
|
||||
#
|
||||
# The expected result follows the LIKE pattern:
|
||||
#
|
||||
# let $result_pattern= '%127.0.0.1%root%1%master-bin.000001%776%slave-relay-bin.000004%master-bin.000001%Yes%No%0%0%319%Master%master-bin.000001%319%No%';
|
||||
#
|
||||
# The Slave_IO_Running value is the "Yes" just after the "master-bin.000001".
|
||||
#
|
||||
# How to get this pattern ?
|
||||
#
|
||||
# Any lines "--replace_result ..." and "--replace_colum ..." just before
|
||||
# the SHOW TABLE STATUS and of course the expected result itself
|
||||
# show us columns where the content must be unified, because it is non
|
||||
# deterministic or it depends on the current test environment.
|
||||
#
|
||||
# Unfortunately "--replace_result ..." and "--replace_colum ..." do not
|
||||
# affect the result of our assignment let $my_val= `SHOW SLAVE STATUS`;
|
||||
# Therefore such content must be covered by '%'.
|
||||
#
|
||||
# Please be careful. A more simple pattern might be dangerous, because we
|
||||
# might get "wrong" matches. Example: There might be several "Yes" and "No"
|
||||
# within one result row.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# We do not want to print the auxiliary commands, because they are not of
|
||||
# interest and their amount will vary depending how fast we get the
|
||||
# desired state.
|
||||
--disable_query_log
|
||||
|
||||
# The protocol should show
|
||||
# - the setting of $result_pattern and
|
||||
# - that this file is sourced ,
|
||||
# because this increases the chance to use the protocol as replay script.
|
||||
eval SELECT "let \$result_pattern= $result_pattern ;" AS "";
|
||||
SELECT '--source include/wait_slave_status.inc' AS "";
|
||||
|
||||
# We accept to wait maximum 30 seconds (0.2 sec/loop).
|
||||
let $max_wait= 150;
|
||||
while ($max_wait)
|
||||
{
|
||||
let $my_val= `SHOW SLAVE STATUS`;
|
||||
# Now we have the first record of the SHOW result set as one fat string
|
||||
# within the variable $my_val.
|
||||
|
||||
eval SET @my_val = '$my_val';
|
||||
# DEBUG eval SELECT @my_val AS "response to SHOW SLAVE STATUS";
|
||||
|
||||
eval SELECT @my_val LIKE $result_pattern INTO @success;
|
||||
# @success is '1' if we have a match
|
||||
# '0' if we have no match
|
||||
# DEBUG SELECT @success;
|
||||
|
||||
let $success= `SELECT @success`;
|
||||
let $no_success= `SELECT @success = 0`;
|
||||
if ($success)
|
||||
{
|
||||
# We reached the expected result and want to jump out of the loop
|
||||
# without unneeded sleeps.
|
||||
# Attention: Do not set $max_wait to 0, because "while" with negative value
|
||||
# does not work.
|
||||
let $max_wait= 1;
|
||||
}
|
||||
if ($no_success)
|
||||
{
|
||||
# We did not reach the expected result and will have to sleep again
|
||||
# or jump out of the loop, when max_wait is exhausted.
|
||||
real_sleep 0.2;
|
||||
}
|
||||
dec $max_wait;
|
||||
}
|
||||
--enable_query_log
|
||||
if ($no_success)
|
||||
{
|
||||
let $message= ! Attention: Timeout in wait_slave_status.inc.
|
||||
| Possible reasons with decreasing probability:
|
||||
| - The LIKE pattern ($result_pattern) is wrong, because the
|
||||
| testcase was altered or the layout of the
|
||||
| SHOW SLAVE STATUS result set changed.
|
||||
| - There is a new bug within the replication.
|
||||
| - We met an extreme testing environment and $max_wait is
|
||||
| too small.;
|
||||
--source include/show_msg80.inc
|
||||
--echo DEBUG INFO START (wait_slave_status.inc):
|
||||
--echo $result_pattern
|
||||
--vertical_results
|
||||
show slave status;
|
||||
--echo DEBUG INFO END
|
||||
}
|
|
@ -36,6 +36,7 @@ sub mtr_show_failed_diff ($) {
|
|||
|
||||
my $reject_file= "r/$tname.reject";
|
||||
my $result_file= "r/$tname.result";
|
||||
my $log_file= "r/$tname.log";
|
||||
my $eval_file= "r/$tname.eval";
|
||||
|
||||
if ( $::opt_suite ne "main" )
|
||||
|
@ -43,10 +44,11 @@ sub mtr_show_failed_diff ($) {
|
|||
$reject_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$reject_file";
|
||||
$result_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$result_file";
|
||||
$eval_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$eval_file";
|
||||
$log_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$log_file";
|
||||
}
|
||||
|
||||
if ( -f $eval_file )
|
||||
{
|
||||
{
|
||||
$result_file= $eval_file;
|
||||
}
|
||||
elsif ( $::opt_result_ext and
|
||||
|
@ -70,6 +72,12 @@ sub mtr_show_failed_diff ($) {
|
|||
print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n";
|
||||
print "to find the reason to this problem and how to report this.\n\n";
|
||||
}
|
||||
|
||||
if ( -f $log_file )
|
||||
{
|
||||
print "Result from queries before failure can be found in $log_file\n";
|
||||
# FIXME Maybe a tail -f -n 10 $log_file here
|
||||
}
|
||||
}
|
||||
|
||||
sub mtr_report_test_name ($) {
|
||||
|
|
|
@ -134,6 +134,7 @@ our $glob_win32= 0; # OS and native Win32 executables
|
|||
our $glob_win32_perl= 0; # ActiveState Win32 Perl
|
||||
our $glob_cygwin_perl= 0; # Cygwin Perl
|
||||
our $glob_cygwin_shell= undef;
|
||||
our $glob_use_libtool= 1;
|
||||
our $glob_mysql_test_dir= undef;
|
||||
our $glob_mysql_bench_dir= undef;
|
||||
our $glob_hostname= undef;
|
||||
|
@ -205,7 +206,6 @@ our $opt_cursor_protocol;
|
|||
our $opt_view_protocol;
|
||||
|
||||
our $opt_current_test;
|
||||
our $opt_ddd;
|
||||
our $opt_debug;
|
||||
our $opt_do_test;
|
||||
our @opt_cases; # The test cases names in argv
|
||||
|
@ -219,9 +219,14 @@ our $opt_gcov;
|
|||
our $opt_gcov_err;
|
||||
our $opt_gcov_msg;
|
||||
|
||||
our $glob_debugger= 0;
|
||||
our $opt_gdb;
|
||||
our $opt_client_gdb;
|
||||
our $opt_ddd;
|
||||
our $opt_client_ddd;
|
||||
our $opt_manual_gdb;
|
||||
our $opt_manual_ddd;
|
||||
our $opt_manual_debug;
|
||||
|
||||
our $opt_gprof;
|
||||
our $opt_gprof_dir;
|
||||
|
@ -278,11 +283,12 @@ our $opt_timer;
|
|||
our $opt_user;
|
||||
our $opt_user_test;
|
||||
|
||||
our $opt_valgrind;
|
||||
our $opt_valgrind_mysqld;
|
||||
our $opt_valgrind_mysqltest;
|
||||
our $opt_valgrind_all;
|
||||
our $opt_valgrind= 0;
|
||||
our $opt_valgrind_mysqld= 0;
|
||||
our $opt_valgrind_mysqltest= 0;
|
||||
our $opt_valgrind_all= 0;
|
||||
our $opt_valgrind_options;
|
||||
our $opt_valgrind_path;
|
||||
|
||||
our $opt_stress= "";
|
||||
our $opt_stress_suite= "main";
|
||||
|
@ -294,8 +300,6 @@ our $opt_stress_test_duration= 0;
|
|||
our $opt_stress_init_file= "";
|
||||
our $opt_stress_test_file= "";
|
||||
|
||||
our $opt_verbose;
|
||||
|
||||
our $opt_wait_for_master;
|
||||
our $opt_wait_for_slave;
|
||||
our $opt_wait_timeout= 10;
|
||||
|
@ -446,6 +450,12 @@ sub initial_setup () {
|
|||
$glob_cygwin_perl= ($^O eq "cygwin");
|
||||
$glob_win32= ($glob_win32_perl or $glob_cygwin_perl);
|
||||
|
||||
# Use libtool on all platforms except windows
|
||||
if ( $glob_win32 )
|
||||
{
|
||||
$glob_use_libtool= 0;
|
||||
}
|
||||
|
||||
# We require that we are in the "mysql-test" directory
|
||||
# to run mysql-test-run
|
||||
|
||||
|
@ -577,9 +587,11 @@ sub command_line_setup () {
|
|||
|
||||
# Debugging
|
||||
'gdb' => \$opt_gdb,
|
||||
'manual-gdb' => \$opt_manual_gdb,
|
||||
'client-gdb' => \$opt_client_gdb,
|
||||
'manual-gdb' => \$opt_manual_gdb,
|
||||
'manual-debug' => \$opt_manual_debug,
|
||||
'ddd' => \$opt_ddd,
|
||||
'client-ddd' => \$opt_client_ddd,
|
||||
'strace-client' => \$opt_strace_client,
|
||||
'master-binary=s' => \$exe_master_mysqld,
|
||||
'slave-binary=s' => \$exe_slave_mysqld,
|
||||
|
@ -587,10 +599,12 @@ sub command_line_setup () {
|
|||
# Coverage, profiling etc
|
||||
'gcov' => \$opt_gcov,
|
||||
'gprof' => \$opt_gprof,
|
||||
'valgrind:s' => \$opt_valgrind,
|
||||
'valgrind-mysqltest:s' => \$opt_valgrind_mysqltest,
|
||||
'valgrind-all:s' => \$opt_valgrind_all,
|
||||
'valgrind' => \$opt_valgrind,
|
||||
'valgrind-mysqltest' => \$opt_valgrind_mysqltest,
|
||||
'valgrind-mysqld' => \$opt_valgrind_mysqld,
|
||||
'valgrind-all' => \$opt_valgrind_all,
|
||||
'valgrind-options=s' => \$opt_valgrind_options,
|
||||
'valgrind-path=s' => \$opt_valgrind_path,
|
||||
|
||||
# Stress testing
|
||||
'stress' => \$opt_stress,
|
||||
|
@ -603,6 +617,10 @@ sub command_line_setup () {
|
|||
'stress-test-count=i' => \$opt_stress_test_count,
|
||||
'stress-test-duration=i' => \$opt_stress_test_duration,
|
||||
|
||||
# Directories
|
||||
'tmpdir=s' => \$opt_tmpdir,
|
||||
'vardir=s' => \$opt_vardir,
|
||||
|
||||
# Misc
|
||||
'big-test' => \$opt_big_test,
|
||||
'comment=s' => \$opt_comment,
|
||||
|
@ -620,12 +638,9 @@ sub command_line_setup () {
|
|||
'start-and-exit' => \$opt_start_and_exit,
|
||||
'start-from=s' => \$opt_start_from,
|
||||
'timer' => \$opt_timer,
|
||||
'tmpdir=s' => \$opt_tmpdir,
|
||||
'unified-diff|udiff' => \$opt_udiff,
|
||||
'user-test=s' => \$opt_user_test,
|
||||
'user=s' => \$opt_user,
|
||||
'vardir=s' => \$opt_vardir,
|
||||
'verbose' => \$opt_verbose,
|
||||
'wait-timeout=i' => \$opt_wait_timeout,
|
||||
'testcase-timeout=i' => \$opt_testcase_timeout,
|
||||
'suite-timeout=i' => \$opt_suite_timeout,
|
||||
|
@ -757,29 +772,17 @@ sub command_line_setup () {
|
|||
mtr_error("Coverage test needs the source - please use source dist");
|
||||
}
|
||||
|
||||
if ( $opt_gdb )
|
||||
# Check debug related options
|
||||
if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd ||
|
||||
$opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug)
|
||||
{
|
||||
# Indicate that we are using debugger
|
||||
$glob_debugger= 1;
|
||||
# Increase timeouts
|
||||
$opt_wait_timeout= 300;
|
||||
if ( $opt_extern )
|
||||
{
|
||||
mtr_error("Can't use --extern with --gdb");
|
||||
}
|
||||
}
|
||||
|
||||
if ( $opt_manual_gdb )
|
||||
{
|
||||
$opt_gdb= 1;
|
||||
if ( $opt_extern )
|
||||
{
|
||||
mtr_error("Can't use --extern with --manual-gdb");
|
||||
}
|
||||
}
|
||||
|
||||
if ( $opt_ddd )
|
||||
{
|
||||
if ( $opt_extern )
|
||||
{
|
||||
mtr_error("Can't use --extern with --ddd");
|
||||
mtr_error("Can't use --extern when using debugger");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -798,22 +801,20 @@ sub command_line_setup () {
|
|||
$opt_with_ndbcluster= 0;
|
||||
}
|
||||
|
||||
# The ":s" in the argument spec, means we have three different cases
|
||||
#
|
||||
# undefined option not set
|
||||
# "" option set with no argument
|
||||
# "somestring" option is name/path of valgrind executable
|
||||
|
||||
# Take executable path from any of them, if any
|
||||
$opt_valgrind_mysqld= $opt_valgrind;
|
||||
$opt_valgrind= $opt_valgrind_mysqltest if $opt_valgrind_mysqltest;
|
||||
$opt_valgrind= $opt_valgrind_all if $opt_valgrind_all;
|
||||
|
||||
# If valgrind flag not defined, define if other valgrind flags are
|
||||
unless ( defined $opt_valgrind )
|
||||
# Turn on valgrinding of all executables if "valgrind" or "valgrind-all"
|
||||
if ( $opt_valgrind or $opt_valgrind_all )
|
||||
{
|
||||
$opt_valgrind= ""
|
||||
if defined $opt_valgrind_mysqltest or defined $opt_valgrind_all;
|
||||
mtr_report("Turning on valgrind for all executables");
|
||||
$opt_valgrind= 1;
|
||||
$opt_valgrind_mysqld= 1;
|
||||
$opt_valgrind_mysqltest= 1;
|
||||
}
|
||||
elsif ( $opt_valgrind_mysqld or $opt_valgrind_mysqltest )
|
||||
{
|
||||
# If test's are run for a specific executable, turn on
|
||||
# verbose and show-reachable
|
||||
$opt_valgrind= 1;
|
||||
$opt_valgrind_all= 1;
|
||||
}
|
||||
|
||||
if ( ! $opt_testcase_timeout )
|
||||
|
@ -828,12 +829,11 @@ sub command_line_setup () {
|
|||
$opt_suite_timeout*= 4 if defined $opt_valgrind;
|
||||
}
|
||||
|
||||
if ( defined $opt_valgrind )
|
||||
# Increase times to wait for executables to start if using valgrind
|
||||
if ( $opt_valgrind )
|
||||
{
|
||||
$opt_sleep_time_after_restart= 10;
|
||||
$opt_sleep_time_for_delete= 60;
|
||||
# >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
|
||||
# valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck"
|
||||
}
|
||||
|
||||
if ( ! $opt_user )
|
||||
|
@ -1023,19 +1023,7 @@ sub executable_setup () {
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( $opt_valgrind_mysqltest )
|
||||
{
|
||||
# client/mysqltest might be a libtool .sh script, so look for real exe
|
||||
# to avoid valgrinding bash ;)
|
||||
$exe_mysqltest=
|
||||
mtr_exe_exists("$path_client_bindir/.libs/lt-mysqltest",
|
||||
"$path_client_bindir/.libs/mysqltest",
|
||||
"$path_client_bindir/mysqltest");
|
||||
}
|
||||
else
|
||||
{
|
||||
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
|
||||
}
|
||||
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
|
||||
$exe_mysql_client_test=
|
||||
mtr_exe_exists("$glob_basedir/tests/mysql_client_test",
|
||||
"$path_client_bindir/mysql_client_test",
|
||||
|
@ -1140,6 +1128,14 @@ sub environment_setup () {
|
|||
($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : "");
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Add the path where mysqld will find udf_example.so
|
||||
# --------------------------------------------------------------------------
|
||||
$ENV{'LD_LIBRARY_PATH'}=
|
||||
"$glob_basedir/sql/.libs" .
|
||||
($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Also command lines in .opt files may contain env vars
|
||||
# --------------------------------------------------------------------------
|
||||
|
@ -1568,8 +1564,9 @@ sub run_suite () {
|
|||
|
||||
mtr_print_line();
|
||||
|
||||
if ( ! $opt_gdb and ! $glob_use_running_server and
|
||||
! $opt_ddd and ! $glob_use_embedded_server )
|
||||
if ( ! $glob_debugger and
|
||||
! $glob_use_running_server and
|
||||
! $glob_use_embedded_server )
|
||||
{
|
||||
stop_masters_slaves();
|
||||
}
|
||||
|
@ -2110,11 +2107,32 @@ sub save_installed_db () {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Save any interesting files in the data_dir
|
||||
# before the data dir is removed.
|
||||
#
|
||||
sub save_files_before_restore($$) {
|
||||
my $test_name= shift;
|
||||
my $data_dir= shift;
|
||||
my $save_name= "$opt_vardir/log/$test_name";
|
||||
|
||||
# Look for core files
|
||||
foreach my $core_file ( glob("$data_dir/core*") )
|
||||
{
|
||||
my $core_name= basename($core_file);
|
||||
mtr_report("Saving $core_name");
|
||||
mkdir($save_name) if ! -d $save_name;
|
||||
rename("$core_file", "$save_name/$core_name");
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Restore snapshot of the installed test db(s)
|
||||
# if the snapshot exists
|
||||
#
|
||||
sub restore_installed_db () {
|
||||
sub restore_installed_db ($) {
|
||||
my $test_name= shift;
|
||||
|
||||
if ( -d $path_snapshot)
|
||||
{
|
||||
|
@ -2125,6 +2143,7 @@ sub restore_installed_db () {
|
|||
foreach my $data_dir (@data_dir_lst)
|
||||
{
|
||||
my $name= basename($data_dir);
|
||||
save_files_before_restore($test_name, $data_dir);
|
||||
rmtree("$data_dir");
|
||||
copy_dir("$path_snapshot/$name", "$data_dir");
|
||||
}
|
||||
|
@ -2152,7 +2171,7 @@ sub report_failure_and_restart ($) {
|
|||
if ( $opt_force )
|
||||
{
|
||||
# Restore the snapshot of the installed test db
|
||||
restore_installed_db();
|
||||
restore_installed_db($tinfo->{'name'});
|
||||
print "Resuming Tests\n\n";
|
||||
return;
|
||||
}
|
||||
|
@ -2160,8 +2179,9 @@ sub report_failure_and_restart ($) {
|
|||
my $test_mode= join(" ", @::glob_test_mode) || "default";
|
||||
print "Aborting: $tinfo->{'name'} failed in $test_mode mode. ";
|
||||
print "To continue, re-run with '--force'.\n";
|
||||
if ( ! $opt_gdb and ! $glob_use_running_server and
|
||||
! $opt_ddd and ! $glob_use_embedded_server )
|
||||
if ( ! $glob_debugger and
|
||||
! $glob_use_running_server and
|
||||
! $glob_use_embedded_server )
|
||||
{
|
||||
stop_masters_slaves();
|
||||
}
|
||||
|
@ -2288,7 +2308,7 @@ sub mysqld_arguments ($$$$$$) {
|
|||
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
|
||||
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
|
||||
|
||||
if ( defined $opt_valgrind_mysqld )
|
||||
if ( $opt_valgrind_mysqld )
|
||||
{
|
||||
mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
|
||||
mtr_add_arg($args, "%s--skip-bdb", $prefix);
|
||||
|
@ -2426,7 +2446,8 @@ sub mysqld_arguments ($$$$$$) {
|
|||
mtr_add_arg($args, "%s--log-warnings", $prefix);
|
||||
}
|
||||
|
||||
if ( $opt_gdb or $opt_client_gdb or $opt_manual_gdb or $opt_ddd)
|
||||
# Indicate to "mysqld" it will be debugged in debugger
|
||||
if ( $glob_debugger )
|
||||
{
|
||||
mtr_add_arg($args, "%s--gdb", $prefix);
|
||||
}
|
||||
|
@ -2502,7 +2523,7 @@ sub mysqld_start ($$$$$) {
|
|||
|
||||
my $args; # Arg vector
|
||||
my $exe;
|
||||
my $pid;
|
||||
my $pid= -1;
|
||||
|
||||
if ( $type eq 'master' )
|
||||
{
|
||||
|
@ -2519,7 +2540,7 @@ sub mysqld_start ($$$$$) {
|
|||
|
||||
mtr_init_args(\$args);
|
||||
|
||||
if ( defined $opt_valgrind_mysqld )
|
||||
if ( $opt_valgrind_mysqld )
|
||||
{
|
||||
valgrind_arguments($args, \$exe);
|
||||
}
|
||||
|
@ -2527,29 +2548,53 @@ sub mysqld_start ($$$$$) {
|
|||
mysqld_arguments($args,$type,$idx,$extra_opt,$slave_master_info,
|
||||
$using_ndbcluster);
|
||||
|
||||
if ( $opt_gdb || $opt_manual_gdb)
|
||||
{
|
||||
gdb_arguments(\$args, \$exe, "$type"."_$idx");
|
||||
}
|
||||
elsif ( $opt_ddd || $opt_manual_ddd )
|
||||
{
|
||||
ddd_arguments(\$args, \$exe, "$type"."_$idx");
|
||||
}
|
||||
elsif ( $opt_manual_debug )
|
||||
{
|
||||
print "\nStart $type in your debugger\n" .
|
||||
"dir: $glob_mysql_test_dir\n" .
|
||||
"exe: $exe\n" .
|
||||
"args: " . join(" ", @$args) . "\n\n" .
|
||||
"Waiting ....\n";
|
||||
|
||||
# Indicate the exe should not be started
|
||||
$exe= undef;
|
||||
}
|
||||
|
||||
if ( $type eq 'master' )
|
||||
{
|
||||
if ( $pid= mtr_spawn($exe, $args, "",
|
||||
$master->[$idx]->{'path_myerr'},
|
||||
$master->[$idx]->{'path_myerr'},
|
||||
"",
|
||||
{ append_log_file => 1 }) )
|
||||
if ( ! defined $exe or
|
||||
$pid= mtr_spawn($exe, $args, "",
|
||||
$master->[$idx]->{'path_myerr'},
|
||||
$master->[$idx]->{'path_myerr'},
|
||||
"",
|
||||
{ append_log_file => 1 }) )
|
||||
{
|
||||
return sleep_until_file_created($master->[$idx]->{'path_mypid'},
|
||||
$master->[$idx]->{'start_timeout'}, $pid);
|
||||
$master->[$idx]->{'start_timeout'},
|
||||
$pid);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $type eq 'slave' )
|
||||
{
|
||||
if ( $pid= mtr_spawn($exe, $args, "",
|
||||
if ( ! defined $exe or
|
||||
$pid= mtr_spawn($exe, $args, "",
|
||||
$slave->[$idx]->{'path_myerr'},
|
||||
$slave->[$idx]->{'path_myerr'},
|
||||
"",
|
||||
{ append_log_file => 1 }) )
|
||||
{
|
||||
return sleep_until_file_created($slave->[$idx]->{'path_mypid'},
|
||||
$master->[$idx]->{'start_timeout'}, $pid);
|
||||
$master->[$idx]->{'start_timeout'},
|
||||
$pid);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2868,7 +2913,7 @@ sub run_mysqltest ($) {
|
|||
|
||||
mtr_init_args(\$args);
|
||||
|
||||
if ( defined $opt_valgrind_mysqltest )
|
||||
if ( $opt_valgrind_mysqltest )
|
||||
{
|
||||
valgrind_arguments($args, \$exe);
|
||||
}
|
||||
|
@ -2988,7 +3033,10 @@ sub run_mysqltest ($) {
|
|||
# Add arguments that should not go into the MYSQL_TEST env var
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
mtr_add_arg($args, "-R");
|
||||
mtr_add_arg($args, "--test-file");
|
||||
mtr_add_arg($args, $tinfo->{'path'});
|
||||
|
||||
mtr_add_arg($args, "--result-file");
|
||||
mtr_add_arg($args, $tinfo->{'result_file'});
|
||||
|
||||
if ( $opt_record )
|
||||
|
@ -2996,21 +3044,169 @@ sub run_mysqltest ($) {
|
|||
mtr_add_arg($args, "--record");
|
||||
}
|
||||
|
||||
if ( $opt_client_gdb )
|
||||
{
|
||||
gdb_arguments(\$args, \$exe, "client");
|
||||
}
|
||||
elsif ( $opt_client_ddd )
|
||||
{
|
||||
ddd_arguments(\$args, \$exe, "client");
|
||||
}
|
||||
|
||||
if ($glob_use_libtool and $opt_valgrind)
|
||||
{
|
||||
# Add "libtool --mode-execute" before the test to execute
|
||||
# if running in valgrind(to avoid valgrinding bash)
|
||||
unshift(@$args, "--mode=execute", $exe);
|
||||
$exe= "libtool";
|
||||
}
|
||||
|
||||
if ( $opt_check_testcases )
|
||||
{
|
||||
run_check_testcase("before");
|
||||
}
|
||||
|
||||
my $res = mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,"");
|
||||
my $res = mtr_run_test($exe,$args,"","",$path_timefile,"");
|
||||
|
||||
if ( $opt_check_testcases )
|
||||
{
|
||||
run_check_testcase("after");
|
||||
}
|
||||
|
||||
return $res;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Modify the exe and args so that program is run in gdb in xterm
|
||||
#
|
||||
sub gdb_arguments {
|
||||
my $args= shift;
|
||||
my $exe= shift;
|
||||
my $type= shift;
|
||||
|
||||
# Write $args to gdb init file
|
||||
my $str= join(" ", @$$args);
|
||||
my $gdb_init_file= "$opt_tmpdir/gdbinit.$type";
|
||||
|
||||
# Remove the old gdbinit file
|
||||
unlink($gdb_init_file);
|
||||
|
||||
if ( $type eq "client" )
|
||||
{
|
||||
# write init file for client
|
||||
mtr_tofile($gdb_init_file,
|
||||
"set args $str\n" .
|
||||
"break main\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
# write init file for mysqld
|
||||
mtr_tofile($gdb_init_file,
|
||||
"set args $str\n" .
|
||||
"break mysql_parse\n" .
|
||||
"commands 1\n" .
|
||||
"disable 1\n" .
|
||||
"end\n" .
|
||||
"run");
|
||||
}
|
||||
|
||||
if ( $opt_manual_gdb )
|
||||
{
|
||||
print "\nTo start gdb for $type, type in another window:\n";
|
||||
print "cd $glob_mysql_test_dir;\n";
|
||||
print "gdb -x $gdb_init_file $$exe\n";
|
||||
|
||||
# Indicate the exe should not be started
|
||||
$$exe= undef;
|
||||
return;
|
||||
}
|
||||
|
||||
$$args= [];
|
||||
mtr_add_arg($$args, "-title");
|
||||
mtr_add_arg($$args, "$type");
|
||||
mtr_add_arg($$args, "-e");
|
||||
|
||||
if ( $glob_use_libtool )
|
||||
{
|
||||
mtr_add_arg($$args, "libtool");
|
||||
mtr_add_arg($$args, "--mode=execute");
|
||||
}
|
||||
|
||||
mtr_add_arg($$args, "gdb");
|
||||
mtr_add_arg($$args, "-x");
|
||||
mtr_add_arg($$args, "$gdb_init_file");
|
||||
mtr_add_arg($$args, "$$exe");
|
||||
|
||||
$$exe= "xterm";
|
||||
}
|
||||
|
||||
#
|
||||
# Modify the exe and args so that program is run in ddd
|
||||
#
|
||||
sub ddd_arguments {
|
||||
my $args= shift;
|
||||
my $exe= shift;
|
||||
my $type= shift;
|
||||
|
||||
# Write $args to ddd init file
|
||||
my $str= join(" ", @$$args);
|
||||
my $gdb_init_file= "$opt_tmpdir/gdbinit.$type";
|
||||
|
||||
# Remove the old gdbinit file
|
||||
unlink($gdb_init_file);
|
||||
|
||||
if ( $type eq "client" )
|
||||
{
|
||||
# write init file for client
|
||||
mtr_tofile($gdb_init_file,
|
||||
"set args $str\n" .
|
||||
"break main\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
# write init file for mysqld
|
||||
mtr_tofile($gdb_init_file,
|
||||
"file $$exe\n" .
|
||||
"set args $str\n" .
|
||||
"break mysql_parse\n" .
|
||||
"commands 1\n" .
|
||||
"disable 1\n" .
|
||||
"end\n" .
|
||||
"run");
|
||||
}
|
||||
|
||||
if ( $opt_manual_ddd )
|
||||
{
|
||||
print "\nTo start ddd for $type, type in another window:\n";
|
||||
print "cd $glob_mysql_test_dir;\n";
|
||||
print "ddd -x $gdb_init_file $$exe\n";
|
||||
|
||||
# Indicate the exe should not be started
|
||||
$$exe= undef;
|
||||
return;
|
||||
}
|
||||
|
||||
my $save_exe= $$exe;
|
||||
$$args= [];
|
||||
if ( $glob_use_libtool )
|
||||
{
|
||||
$$exe= "libtool";
|
||||
mtr_add_arg($$args, "--mode=execute");
|
||||
mtr_add_arg($$args, "ddd");
|
||||
}
|
||||
else
|
||||
{
|
||||
$$exe= "ddd";
|
||||
}
|
||||
mtr_add_arg($$args, "--command=$gdb_init_file");
|
||||
mtr_add_arg($$args, "$save_exe");
|
||||
}
|
||||
|
||||
#
|
||||
# Modify the exe and args so that program is run in valgrind
|
||||
#
|
||||
sub valgrind_arguments {
|
||||
my $args= shift;
|
||||
my $exe= shift;
|
||||
|
@ -3022,7 +3218,7 @@ sub valgrind_arguments {
|
|||
mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
|
||||
if -f "$glob_mysql_test_dir/valgrind.supp";
|
||||
|
||||
if ( defined $opt_valgrind_all )
|
||||
if ( $opt_valgrind_all )
|
||||
{
|
||||
mtr_add_arg($args, "-v");
|
||||
mtr_add_arg($args, "--show-reachable=yes");
|
||||
|
@ -3030,14 +3226,13 @@ sub valgrind_arguments {
|
|||
|
||||
if ( $opt_valgrind_options )
|
||||
{
|
||||
# FIXME split earlier and put into @glob_valgrind_*
|
||||
mtr_add_arg($args, split(' ', $opt_valgrind_options));
|
||||
}
|
||||
|
||||
|
||||
mtr_add_arg($args, $$exe);
|
||||
|
||||
$$exe= $opt_valgrind || "valgrind";
|
||||
$$exe= $opt_valgrind_path || "valgrind";
|
||||
}
|
||||
|
||||
|
||||
|
@ -3068,6 +3263,13 @@ Options to control what engine/variation to run
|
|||
bench Run the benchmark suite FIXME
|
||||
small-bench FIXME
|
||||
|
||||
Options to control directories to use
|
||||
vardir=DIR The directory where files generated from the test run
|
||||
is stored(default: ./var). Specifying a ramdisk or tmpfs
|
||||
will speed up tests.
|
||||
tmpdir=DIR The directory where temporary files are stored
|
||||
(default: ./var/tmp).
|
||||
|
||||
Options to control what test suites or cases to run
|
||||
|
||||
force Continue to run the suite after failure
|
||||
|
@ -3103,10 +3305,12 @@ Options to run test on running server
|
|||
|
||||
Options for debugging the product
|
||||
|
||||
gdb FIXME
|
||||
manual-gdb FIXME
|
||||
client-gdb FIXME
|
||||
ddd FIXME
|
||||
gdb Start the mysqld(s) in gdb
|
||||
manual-gdb Let user manually start mysqld in gdb, before running test(s)
|
||||
manual-debug Let user manually start mysqld in debugger, before running test(s)
|
||||
client-gdb Start mysqltest client in gdb
|
||||
ddd Start mysqld in ddd
|
||||
client-ddd Start mysqltest client in ddd
|
||||
strace-client FIXME
|
||||
master-binary=PATH Specify the master "mysqld" to use
|
||||
slave-binary=PATH Specify the slave "mysqld" to use
|
||||
|
@ -3115,16 +3319,17 @@ Options for coverage, profiling etc
|
|||
|
||||
gcov FIXME
|
||||
gprof FIXME
|
||||
valgrind[=EXE] Run the "mysqld" server using valgrind, optionally
|
||||
specifying the executable path/name
|
||||
valgrind-mysqltest[=EXE] In addition, run the "mysqltest" executable with valgrind
|
||||
valgrind-all[=EXE] Adds verbose flag, and --show-reachable to valgrind
|
||||
valgrind Run the "mysqltest" and "mysqld" executables using valgrind
|
||||
valgrind-all Same as "valgrind" but will also add "verbose" and "--show-reachable"
|
||||
flags to valgrind
|
||||
valgrind-mysqltest Run the "mysqltest" executable with valgrind
|
||||
valgrind-mysqld Run the "mysqld" executable with valgrind
|
||||
valgrind-options=ARGS Extra options to give valgrind
|
||||
valgrind-path=[EXE] Path to the valgrind executable
|
||||
|
||||
Misc options
|
||||
|
||||
comment=STR Write STR to the output
|
||||
verbose Verbose output from this script
|
||||
script-debug Debug this script itself
|
||||
timer Show test case execution time
|
||||
start-and-exit Only initiate and start the "mysqld" servers, use the startup
|
||||
|
@ -3152,7 +3357,6 @@ Options not yet described, or that I want to look into more
|
|||
old-master
|
||||
sleep=SECONDS
|
||||
socket=PATH
|
||||
tmpdir=DIR
|
||||
user-test=s
|
||||
wait-timeout=SECONDS
|
||||
warnings
|
||||
|
|
|
@ -189,3 +189,6 @@ select hex(a) from t1 where a = _big5 0xF9DC;
|
|||
hex(a)
|
||||
E5ABBA
|
||||
drop table t1;
|
||||
select hex(convert(_big5 0xC84041 using ucs2));
|
||||
hex(convert(_big5 0xC84041 using ucs2))
|
||||
003F0041
|
||||
|
|
|
@ -15,3 +15,32 @@ SELECT HEX(f1) FROM t1;
|
|||
HEX(f1)
|
||||
8300
|
||||
DROP table t1;
|
||||
CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
|
||||
s2 CHAR(50) CHARACTER SET cp932,
|
||||
d DECIMAL(10,2))|
|
||||
CREATE PROCEDURE bug18293 (IN ins1 CHAR(50),
|
||||
IN ins2 CHAR(50) CHARACTER SET cp932,
|
||||
IN ind DECIMAL(10,2))
|
||||
BEGIN
|
||||
INSERT INTO t4 VALUES (ins1, ins2, ind);
|
||||
END|
|
||||
CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
|
||||
SELECT HEX(s1),HEX(s2),d FROM t4|
|
||||
HEX(s1) HEX(s2) d
|
||||
466F6F2773206120426172 ED40ED41ED42 47.93
|
||||
DROP PROCEDURE bug18293|
|
||||
DROP TABLE t4|
|
||||
SHOW BINLOG EVENTS FROM 393|
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 393 Query 1 556 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
|
||||
s2 CHAR(50) CHARACTER SET cp932,
|
||||
d DECIMAL(10,2))
|
||||
master-bin.000001 556 Query 1 801 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50),
|
||||
IN ins2 CHAR(50) CHARACTER SET cp932,
|
||||
IN ind DECIMAL(10,2))
|
||||
BEGIN
|
||||
INSERT INTO t4 VALUES (ins1, ins2, ind);
|
||||
END
|
||||
master-bin.000001 801 Query 1 1006 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1'Foo\'s a Bar'), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
|
||||
master-bin.000001 1006 Query 1 1092 use `test`; DROP PROCEDURE bug18293
|
||||
master-bin.000001 1092 Query 1 1168 use `test`; DROP TABLE t4
|
||||
|
|
|
@ -9819,3 +9819,9 @@ eucjpms_bin 6109
|
|||
eucjpms_bin 61
|
||||
eucjpms_bin 6120
|
||||
drop table t1;
|
||||
select hex(convert(_eucjpms 0xA5FE41 using ucs2));
|
||||
hex(convert(_eucjpms 0xA5FE41 using ucs2))
|
||||
003F0041
|
||||
select hex(convert(_eucjpms 0x8FABF841 using ucs2));
|
||||
hex(convert(_eucjpms 0x8FABF841 using ucs2))
|
||||
003F0041
|
||||
|
|
|
@ -165,3 +165,6 @@ hex(a)
|
|||
A1A1
|
||||
A3A0
|
||||
DROP TABLE t1;
|
||||
select hex(convert(_gbk 0xA14041 using ucs2));
|
||||
hex(convert(_gbk 0xA14041 using ucs2))
|
||||
003F0041
|
||||
|
|
30
mysql-test/r/ctype_latin2_ch.result
Normal file
30
mysql-test/r/ctype_latin2_ch.result
Normal file
|
@ -0,0 +1,30 @@
|
|||
drop table if exists t1;
|
||||
set names latin2;
|
||||
select 'A' = 'a' collate latin2_czech_cs;
|
||||
'A' = 'a' collate latin2_czech_cs
|
||||
0
|
||||
create table t1 (
|
||||
id int(5) not null,
|
||||
tt char(255) not null
|
||||
) character set latin2 collate latin2_czech_cs;
|
||||
insert into t1 values (1,'Aa');
|
||||
insert into t1 values (2,'Aas');
|
||||
alter table t1 add primary key aaa(tt);
|
||||
select * from t1 where tt like 'Aa%';
|
||||
id tt
|
||||
1 Aa
|
||||
2 Aas
|
||||
select * from t1 ignore index (primary) where tt like 'Aa%';
|
||||
id tt
|
||||
1 Aa
|
||||
2 Aas
|
||||
select * from t1 where tt like '%Aa%';
|
||||
id tt
|
||||
1 Aa
|
||||
2 Aas
|
||||
select * from t1 where tt like 'AA%';
|
||||
id tt
|
||||
select * from t1 ignore index (primary) where tt like 'AA%';
|
||||
id tt
|
||||
select * from t1 where tt like '%AA%';
|
||||
id tt
|
6
mysql-test/r/ctype_ucs2_def.result
Normal file
6
mysql-test/r/ctype_ucs2_def.result
Normal file
|
@ -0,0 +1,6 @@
|
|||
show variables like "%character_set_ser%";
|
||||
Variable_name Value
|
||||
character_set_server ucs2
|
||||
DROP TABLE IF EXISTS t1;
|
||||
create table t1 (a int);
|
||||
drop table t1;
|
|
@ -2307,6 +2307,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
|
|||
c2h
|
||||
ab_def
|
||||
drop table t1;
|
||||
select hex(convert(_ujis 0xA5FE41 using ucs2));
|
||||
hex(convert(_ujis 0xA5FE41 using ucs2))
|
||||
003F0041
|
||||
select hex(convert(_ujis 0x8FABF841 using ucs2));
|
||||
hex(convert(_ujis 0x8FABF841 using ucs2))
|
||||
003F0041
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
set names ujis;
|
||||
|
|
|
@ -447,12 +447,12 @@ t1 CREATE TABLE `t1` (
|
|||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a TEXT, FULLTEXT KEY(a));
|
||||
INSERT INTO t1 VALUES('test'),('test1'),('test');
|
||||
PREPARE stmt from "SELECT a, MATCH(a) AGAINST('test1 test') FROM t1 WHERE MATCH(a) AGAINST('test1 test')";
|
||||
PREPARE stmt from "SELECT a, FORMAT(MATCH(a) AGAINST('test1 test'),6) FROM t1 WHERE MATCH(a) AGAINST('test1 test')";
|
||||
EXECUTE stmt;
|
||||
a MATCH(a) AGAINST('test1 test')
|
||||
test1 0.68526661396027
|
||||
a FORMAT(MATCH(a) AGAINST('test1 test'),6)
|
||||
test1 0.685267
|
||||
EXECUTE stmt;
|
||||
a MATCH(a) AGAINST('test1 test')
|
||||
test1 0.68526661396027
|
||||
a FORMAT(MATCH(a) AGAINST('test1 test'),6)
|
||||
test1 0.685267
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
|
|
2
mysql-test/r/have_latin2_ch.require
Normal file
2
mysql-test/r/have_latin2_ch.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
Collation Charset Id Default Compiled Sortlen
|
||||
latin2_czech_cs latin2 2 Yes 4
|
1
mysql-test/r/have_udf.require
Normal file
1
mysql-test/r/have_udf.require
Normal file
|
@ -0,0 +1 @@
|
|||
CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
|
|
@ -577,6 +577,25 @@ pk1 b c
|
|||
2 2 17
|
||||
4 4 3
|
||||
6 6 3
|
||||
DELETE FROM t1;
|
||||
CREATE UNIQUE INDEX bi ON t1(b);
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10;
|
||||
select * from t1 order by pk1;
|
||||
pk1 b c
|
||||
2 2 2
|
||||
3 3 3
|
||||
4 4 4
|
||||
5 5 5
|
||||
6 6 6
|
||||
7 7 7
|
||||
8 8 8
|
||||
9 9 9
|
||||
10 10 10
|
||||
11 11 1
|
||||
21 21 21
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a INT) ENGINE=ndb;
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
|
@ -586,7 +605,7 @@ INSERT IGNORE INTO t1 SELECT a FROM t1;
|
|||
INSERT IGNORE INTO t1 SELECT a FROM t1;
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
1
|
||||
|
@ -606,4 +625,11 @@ a
|
|||
1
|
||||
1
|
||||
1
|
||||
DELETE FROM t1;
|
||||
CREATE UNIQUE INDEX ai ON t1(a);
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -19,3 +19,15 @@ gesuchnr benutzer_id
|
|||
2 1
|
||||
3 2
|
||||
drop table t1;
|
||||
CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT,
|
||||
j INT,
|
||||
k INT,
|
||||
UNIQUE INDEX(j)
|
||||
) ENGINE = ndb;
|
||||
INSERT INTO t1 VALUES (1,1,23),(2,2,24);
|
||||
REPLACE INTO t1 (j,k) VALUES (1,42);
|
||||
REPLACE INTO t1 (i,j) VALUES (17,2);
|
||||
SELECT * from t1 ORDER BY i;
|
||||
i j k
|
||||
3 1 42
|
||||
17 2 24
|
||||
|
|
|
@ -3163,3 +3163,9 @@ t
|
|||
crash1
|
||||
crash1
|
||||
drop table t1;
|
||||
create table t1 (c int, key(c));
|
||||
insert into t1 values (1142477582), (1142455969);
|
||||
create table t2 (a int, b int);
|
||||
insert into t2 values (2, 1), (1, 0);
|
||||
delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
|
||||
drop table t1, t2;
|
||||
|
|
87
mysql-test/r/udf.result
Normal file
87
mysql-test/r/udf.result
Normal file
|
@ -0,0 +1,87 @@
|
|||
drop table if exists t1;
|
||||
CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
|
||||
CREATE FUNCTION myfunc_double RETURNS REAL SONAME 'udf_example.so';
|
||||
CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME 'udf_example.so';
|
||||
ERROR HY000: Can't find function 'myfunc_nonexist' in library
|
||||
CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME 'udf_example.so';
|
||||
CREATE FUNCTION sequence RETURNS INTEGER SONAME "udf_example.so";
|
||||
CREATE FUNCTION lookup RETURNS STRING SONAME 'udf_example.so';
|
||||
CREATE FUNCTION reverse_lookup
|
||||
RETURNS STRING SONAME 'udf_example.so';
|
||||
CREATE AGGREGATE FUNCTION avgcost
|
||||
RETURNS REAL SONAME 'udf_example.so';
|
||||
select myfunc_double();
|
||||
ERROR HY000: myfunc_double must have at least one argument
|
||||
select myfunc_double(1);
|
||||
myfunc_double(1)
|
||||
49.00
|
||||
select myfunc_double(78654);
|
||||
myfunc_double(78654)
|
||||
54.00
|
||||
select myfunc_nonexist();
|
||||
ERROR 42000: FUNCTION test.myfunc_nonexist does not exist
|
||||
select myfunc_int();
|
||||
myfunc_int()
|
||||
0
|
||||
select lookup();
|
||||
ERROR HY000: Wrong arguments to lookup; Use the source
|
||||
select lookup("127.0.0.1");
|
||||
lookup("127.0.0.1")
|
||||
127.0.0.1
|
||||
select lookup(127,0,0,1);
|
||||
ERROR HY000: Wrong arguments to lookup; Use the source
|
||||
select lookup("localhost");
|
||||
lookup("localhost")
|
||||
127.0.0.1
|
||||
select reverse_lookup();
|
||||
ERROR HY000: Wrong number of arguments to reverse_lookup; Use the source
|
||||
select reverse_lookup("127.0.0.1");
|
||||
select reverse_lookup(127,0,0,1);
|
||||
select reverse_lookup("localhost");
|
||||
reverse_lookup("localhost")
|
||||
NULL
|
||||
select avgcost();
|
||||
ERROR HY000: wrong number of arguments: AVGCOST() requires two arguments
|
||||
select avgcost(100,23.76);
|
||||
ERROR HY000: wrong argument type: AVGCOST() requires an INT and a REAL
|
||||
create table t1(sum int, price float(24));
|
||||
insert into t1 values(100, 50.00), (100, 100.00);
|
||||
select avgcost(sum, price) from t1;
|
||||
avgcost(sum, price)
|
||||
75.0000
|
||||
delete from t1;
|
||||
insert into t1 values(100, 54.33), (200, 199.99);
|
||||
select avgcost(sum, price) from t1;
|
||||
avgcost(sum, price)
|
||||
151.4367
|
||||
drop table t1;
|
||||
select metaphon('hello');
|
||||
metaphon('hello')
|
||||
HL
|
||||
CREATE PROCEDURE `XXX1`(in testval varchar(10))
|
||||
begin
|
||||
select metaphon(testval);
|
||||
end//
|
||||
call XXX1('hello');
|
||||
metaphon(testval)
|
||||
HL
|
||||
drop procedure xxx1;
|
||||
CREATE PROCEDURE `XXX2`()
|
||||
begin
|
||||
declare testval varchar(10);
|
||||
set testval = 'hello';
|
||||
select metaphon(testval);
|
||||
end//
|
||||
call XXX2();
|
||||
metaphon(testval)
|
||||
HL
|
||||
drop procedure xxx2;
|
||||
DROP FUNCTION metaphon;
|
||||
DROP FUNCTION myfunc_double;
|
||||
DROP FUNCTION myfunc_nonexist;
|
||||
ERROR 42000: FUNCTION test.myfunc_nonexist does not exist
|
||||
DROP FUNCTION myfunc_int;
|
||||
DROP FUNCTION sequence;
|
||||
DROP FUNCTION lookup;
|
||||
DROP FUNCTION reverse_lookup;
|
||||
DROP FUNCTION avgcost;
|
|
@ -53,4 +53,14 @@ alter table t1 convert to character set utf8;
|
|||
select hex(a) from t1 where a = _big5 0xF9DC;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bugs#15375: Unassigned multibyte codes are broken
|
||||
# into parts when converting to Unicode.
|
||||
# This query should return 0x003F0041. I.e. it should
|
||||
# scan unassigned double-byte character 0xC840, convert
|
||||
# it as QUESTION MARK 0x003F and then scan the next
|
||||
# character, which is a single byte character 0x41.
|
||||
#
|
||||
select hex(convert(_big5 0xC84041 using ucs2));
|
||||
|
||||
# End of 4.1 tests
|
||||
|
|
|
@ -32,3 +32,26 @@ DROP table t1;
|
|||
# end test for bug#11338
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
# Bug#18293: Values in stored procedure written to binlog unescaped
|
||||
#
|
||||
|
||||
delimiter |;
|
||||
CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
|
||||
s2 CHAR(50) CHARACTER SET cp932,
|
||||
d DECIMAL(10,2))|
|
||||
CREATE PROCEDURE bug18293 (IN ins1 CHAR(50),
|
||||
IN ins2 CHAR(50) CHARACTER SET cp932,
|
||||
IN ind DECIMAL(10,2))
|
||||
BEGIN
|
||||
INSERT INTO t4 VALUES (ins1, ins2, ind);
|
||||
END|
|
||||
CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
|
||||
SELECT HEX(s1),HEX(s2),d FROM t4|
|
||||
DROP PROCEDURE bug18293|
|
||||
DROP TABLE t4|
|
||||
SHOW BINLOG EVENTS FROM 393|
|
||||
delimiter ;|
|
||||
|
||||
# End of 5.0 tests
|
||||
|
|
|
@ -363,3 +363,20 @@ SET collation_connection='eucjpms_japanese_ci';
|
|||
-- source include/ctype_filesort.inc
|
||||
SET collation_connection='eucjpms_bin';
|
||||
-- source include/ctype_filesort.inc
|
||||
|
||||
|
||||
#
|
||||
# Bugs#15375: Unassigned multibyte codes are broken
|
||||
# into parts when converting to Unicode.
|
||||
# This query should return 0x003F0041. I.e. it should
|
||||
# scan unassigned double-byte character 0xA5FE, convert
|
||||
# it as QUESTION MARK 0x003F and then scan the next
|
||||
# character, which is a single byte character 0x41.
|
||||
#
|
||||
select hex(convert(_eucjpms 0xA5FE41 using ucs2));
|
||||
# This one should return 0x003F0041:
|
||||
# scan unassigned three-byte character 0x8FABF8,
|
||||
# convert it as QUESTION MARK 0x003F and then scan
|
||||
# the next character, which is a single byte character 0x41.
|
||||
select hex(convert(_eucjpms 0x8FABF841 using ucs2));
|
||||
|
||||
|
|
|
@ -31,4 +31,14 @@ INSERT INTO t1 VALUES (0xA3A0),(0xA1A1);
|
|||
SELECT hex(a) FROM t1 ORDER BY a;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bugs#15375: Unassigned multibyte codes are broken
|
||||
# into parts when converting to Unicode.
|
||||
# This query should return 0x003F0041. I.e. it should
|
||||
# scan unassigned double-byte character 0xA140, convert
|
||||
# it as QUESTION MARK 0x003F and then scan the next
|
||||
# character, which is a single byte character 0x41.
|
||||
#
|
||||
select hex(convert(_gbk 0xA14041 using ucs2));
|
||||
|
||||
# End of 4.1 tests
|
||||
|
|
30
mysql-test/t/ctype_latin2_ch.test
Normal file
30
mysql-test/t/ctype_latin2_ch.test
Normal file
|
@ -0,0 +1,30 @@
|
|||
-- source include/have_latin2_ch.inc
|
||||
|
||||
#
|
||||
# Tests with latin2_czech_cs
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug#17374: select ... like 'A%' operator fails
|
||||
# to find value on columuns with key
|
||||
#
|
||||
set names latin2;
|
||||
select 'A' = 'a' collate latin2_czech_cs;
|
||||
create table t1 (
|
||||
id int(5) not null,
|
||||
tt char(255) not null
|
||||
) character set latin2 collate latin2_czech_cs;
|
||||
insert into t1 values (1,'Aa');
|
||||
insert into t1 values (2,'Aas');
|
||||
alter table t1 add primary key aaa(tt);
|
||||
select * from t1 where tt like 'Aa%';
|
||||
select * from t1 ignore index (primary) where tt like 'Aa%';
|
||||
select * from t1 where tt like '%Aa%';
|
||||
select * from t1 where tt like 'AA%';
|
||||
select * from t1 ignore index (primary) where tt like 'AA%';
|
||||
select * from t1 where tt like '%AA%';
|
||||
|
||||
# End of 4.1 tests
|
1
mysql-test/t/ctype_ucs2_def-master.opt
Normal file
1
mysql-test/t/ctype_ucs2_def-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--default-character-set=ucs2 --default-collation=ucs2_unicode_ci
|
9
mysql-test/t/ctype_ucs2_def.test
Normal file
9
mysql-test/t/ctype_ucs2_def.test
Normal file
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
# Bug#18004 Connecting crashes server when default charset is UCS2
|
||||
#
|
||||
show variables like "%character_set_ser%";
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
create table t1 (a int);
|
||||
drop table t1;
|
|
@ -1152,6 +1152,21 @@ SET collation_connection='ujis_bin';
|
|||
-- source include/ctype_innodb_like.inc
|
||||
-- source include/ctype_like_escape.inc
|
||||
|
||||
#
|
||||
# Bugs#15375: Unassigned multibyte codes are broken
|
||||
# into parts when converting to Unicode.
|
||||
# This query should return 0x003F0041. I.e. it should
|
||||
# scan unassigned double-byte character 0xA5FE, convert
|
||||
# it as QUESTION MARK 0x003F and then scan the next
|
||||
# character, which is a single byte character 0x41.
|
||||
#
|
||||
select hex(convert(_ujis 0xA5FE41 using ucs2));
|
||||
# This one should return 0x003F0041:
|
||||
# scan unassigned three-byte character 0x8FABF8,
|
||||
# convert it as QUESTION MARK 0x003F and then scan
|
||||
# the next character, which is a single byte character 0x41.
|
||||
select hex(convert(_ujis 0x8FABF841 using ucs2));
|
||||
|
||||
# End of 4.1 tests
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
|
|
|
@ -371,7 +371,7 @@ DROP TABLE t1;
|
|||
#
|
||||
CREATE TABLE t1 (a TEXT, FULLTEXT KEY(a));
|
||||
INSERT INTO t1 VALUES('test'),('test1'),('test');
|
||||
PREPARE stmt from "SELECT a, MATCH(a) AGAINST('test1 test') FROM t1 WHERE MATCH(a) AGAINST('test1 test')";
|
||||
PREPARE stmt from "SELECT a, FORMAT(MATCH(a) AGAINST('test1 test'),6) FROM t1 WHERE MATCH(a) AGAINST('test1 test')";
|
||||
EXECUTE stmt;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
|
|
@ -591,14 +591,14 @@ DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6;
|
|||
INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b;
|
||||
select * from t1 where pk1 = b and b != c order by pk1;
|
||||
|
||||
# The following test case currently does not work
|
||||
#DELETE FROM t1;
|
||||
#CREATE UNIQUE INDEX bi ON t1(b);
|
||||
#INSERT INTO t1 VALUES
|
||||
#(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
#(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
#INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,c=b+10;
|
||||
#select * from t1 order by pk1;
|
||||
# Test handling of duplicate unique
|
||||
DELETE FROM t1;
|
||||
CREATE UNIQUE INDEX bi ON t1(b);
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10;
|
||||
select * from t1 order by pk1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
@ -614,7 +614,12 @@ INSERT IGNORE INTO t1 SELECT a FROM t1;
|
|||
INSERT IGNORE INTO t1 SELECT a FROM t1;
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
DELETE FROM t1;
|
||||
CREATE UNIQUE INDEX ai ON t1(a);
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
|
|
@ -27,4 +27,15 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
|||
select * from t1 order by gesuchnr;
|
||||
drop table t1;
|
||||
|
||||
# bug#17431
|
||||
CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT,
|
||||
j INT,
|
||||
k INT,
|
||||
UNIQUE INDEX(j)
|
||||
) ENGINE = ndb;
|
||||
INSERT INTO t1 VALUES (1,1,23),(2,2,24);
|
||||
REPLACE INTO t1 (j,k) VALUES (1,42);
|
||||
REPLACE INTO t1 (i,j) VALUES (17,2);
|
||||
SELECT * from t1 ORDER BY i;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
|
|
@ -2074,3 +2074,14 @@ create table t1( f1 int,f2 int);
|
|||
insert into t1 values (1,1),(2,2);
|
||||
select tt.t from (select 'crash1' as t, f2 from t1) as tt left join t1 on tt.t = 'crash2' and tt.f2 = t1.f2 where tt.t = 'crash1';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #18306: server crash on delete using subquery.
|
||||
#
|
||||
|
||||
create table t1 (c int, key(c));
|
||||
insert into t1 values (1142477582), (1142455969);
|
||||
create table t2 (a int, b int);
|
||||
insert into t2 values (2, 1), (1, 0);
|
||||
delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
|
||||
drop table t1, t2;
|
||||
|
|
|
@ -116,10 +116,15 @@ drop table if exists t1;
|
|||
# Check conversion of floats to character field (Bug #7774)
|
||||
create table t1 (c char(20));
|
||||
insert into t1 values (5e-28);
|
||||
# Expected result is "5e-28", but windows returns "5e-028"
|
||||
--replace_result 5e-028 5e-28
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
create table t1 (c char(6));
|
||||
insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
|
||||
# Expected result is "2e+06", but windows returns "2e+006"
|
||||
# Expected result is "2e-05", but windows returns "2e-005"
|
||||
--replace_result 2e+006 2e+06 2e-005 2e-05
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
|
|
@ -1050,6 +1050,10 @@ while ($max_power)
|
|||
}
|
||||
SELECT my_float, my_double, my_varchar FROM t1;
|
||||
|
||||
# Expected result 0.000000000011754943372854760000
|
||||
# On windows we get 0.000000000011754943372854770000
|
||||
# use replace_result to correct it
|
||||
--replace_result 0.000000000011754943372854770000 0.000000000011754943372854760000
|
||||
SELECT CAST(my_float AS DECIMAL(65,30)), my_float FROM t1;
|
||||
SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1;
|
||||
SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1;
|
||||
|
@ -1061,7 +1065,13 @@ SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1;
|
|||
|
||||
--disable_warnings
|
||||
UPDATE t1 SET my_decimal = my_float;
|
||||
|
||||
# Expected result 0.000000000011754943372854760000
|
||||
# On windows we get 0.000000000011754943372854770000
|
||||
# use replace_result to correct it
|
||||
--replace_result 0.000000000011754943372854770000 0.000000000011754943372854760000
|
||||
SELECT my_decimal, my_float FROM t1;
|
||||
|
||||
UPDATE t1 SET my_decimal = my_double;
|
||||
SELECT my_decimal, my_double FROM t1;
|
||||
--enable_warnings
|
||||
|
|
108
mysql-test/t/udf.test
Normal file
108
mysql-test/t/udf.test
Normal file
|
@ -0,0 +1,108 @@
|
|||
--source include/have_udf.inc
|
||||
#
|
||||
# To run this tests the "sql/udf_example.cc" need to be compiled into
|
||||
# udf_example.so and LD_LIBRARY_PATH should be setup to point out where
|
||||
# the library are.
|
||||
#
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Create the example functions from udf_example
|
||||
#
|
||||
|
||||
CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
|
||||
CREATE FUNCTION myfunc_double RETURNS REAL SONAME 'udf_example.so';
|
||||
|
||||
--error ER_CANT_FIND_DL_ENTRY
|
||||
CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME 'udf_example.so';
|
||||
CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME 'udf_example.so';
|
||||
CREATE FUNCTION sequence RETURNS INTEGER SONAME "udf_example.so";
|
||||
CREATE FUNCTION lookup RETURNS STRING SONAME 'udf_example.so';
|
||||
CREATE FUNCTION reverse_lookup
|
||||
RETURNS STRING SONAME 'udf_example.so';
|
||||
CREATE AGGREGATE FUNCTION avgcost
|
||||
RETURNS REAL SONAME 'udf_example.so';
|
||||
|
||||
--error 0
|
||||
select myfunc_double();
|
||||
select myfunc_double(1);
|
||||
select myfunc_double(78654);
|
||||
--error 1305
|
||||
select myfunc_nonexist();
|
||||
select myfunc_int();
|
||||
--error 0
|
||||
select lookup();
|
||||
select lookup("127.0.0.1");
|
||||
--error 0
|
||||
select lookup(127,0,0,1);
|
||||
select lookup("localhost");
|
||||
--error 0
|
||||
select reverse_lookup();
|
||||
|
||||
# These two functions should return "localhost", but it's
|
||||
# depending on configuration, so just call them and don't log the result
|
||||
--disable_result_log
|
||||
select reverse_lookup("127.0.0.1");
|
||||
select reverse_lookup(127,0,0,1);
|
||||
--enable_result_log
|
||||
|
||||
select reverse_lookup("localhost");
|
||||
--error 0
|
||||
select avgcost();
|
||||
--error 0
|
||||
select avgcost(100,23.76);
|
||||
create table t1(sum int, price float(24));
|
||||
insert into t1 values(100, 50.00), (100, 100.00);
|
||||
select avgcost(sum, price) from t1;
|
||||
delete from t1;
|
||||
insert into t1 values(100, 54.33), (200, 199.99);
|
||||
select avgcost(sum, price) from t1;
|
||||
drop table t1;
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# BUG#17261 Passing a variable from a stored procedure to UDF crashes mysqld
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
select metaphon('hello');
|
||||
|
||||
delimiter //;
|
||||
CREATE PROCEDURE `XXX1`(in testval varchar(10))
|
||||
begin
|
||||
select metaphon(testval);
|
||||
end//
|
||||
delimiter ;//
|
||||
|
||||
call XXX1('hello');
|
||||
drop procedure xxx1;
|
||||
|
||||
delimiter //;
|
||||
CREATE PROCEDURE `XXX2`()
|
||||
begin
|
||||
declare testval varchar(10);
|
||||
set testval = 'hello';
|
||||
select metaphon(testval);
|
||||
end//
|
||||
delimiter ;//
|
||||
|
||||
call XXX2();
|
||||
drop procedure xxx2;
|
||||
|
||||
|
||||
#
|
||||
# Drop the example functions from udf_example
|
||||
#
|
||||
|
||||
DROP FUNCTION metaphon;
|
||||
DROP FUNCTION myfunc_double;
|
||||
--error ER_SP_DOES_NOT_EXIST
|
||||
DROP FUNCTION myfunc_nonexist;
|
||||
DROP FUNCTION myfunc_int;
|
||||
DROP FUNCTION sequence;
|
||||
DROP FUNCTION lookup;
|
||||
DROP FUNCTION reverse_lookup;
|
||||
DROP FUNCTION avgcost;
|
||||
|
|
@ -20,6 +20,8 @@ select @test, @`test`, @TEST, @`TEST`, @"teSt";
|
|||
set @select=2,@t5=1.23456;
|
||||
select @`select`,@not_used;
|
||||
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
|
||||
# Expected result "1e-10", windows returns "1e-010"
|
||||
--replace_result 1e-010 1e-10
|
||||
select @test_int,@test_double,@test_string,@test_string2,@select;
|
||||
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
|
||||
select @test_int,@test_double,@test_string,@test_string2;
|
||||
|
|
|
@ -129,6 +129,11 @@ public:
|
|||
*/
|
||||
int deleteTuple();
|
||||
|
||||
/**
|
||||
* Get index object for this operation
|
||||
*/
|
||||
const NdbDictionary::Index * getIndex() const;
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
|
||||
/**
|
||||
* Define the NdbIndexOperation to be a standard operation of type
|
||||
|
|
|
@ -55,10 +55,33 @@ public:
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Different access types (supported by sub-classes of NdbOperation)
|
||||
*/
|
||||
|
||||
enum Type {
|
||||
PrimaryKeyAccess ///< Read, insert, update, or delete using pk
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
= 0 // NdbOperation
|
||||
#endif
|
||||
,UniqueIndexAccess ///< Read, update, or delete using unique index
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
= 1 // NdbIndexOperation
|
||||
#endif
|
||||
,TableScan ///< Full table scan
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
= 2 // NdbScanOperation
|
||||
#endif
|
||||
,OrderedIndexScan ///< Ordered index scan
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
= 3 // NdbIndexScanOperation
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* Lock when performing read
|
||||
*/
|
||||
|
||||
|
||||
enum LockMode {
|
||||
LM_Read ///< Read with shared lock
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
|
@ -715,6 +738,11 @@ public:
|
|||
*/
|
||||
const NdbDictionary::Table * getTable() const;
|
||||
|
||||
/**
|
||||
* Get the type of access for this operation
|
||||
*/
|
||||
const Type getType() const;
|
||||
|
||||
/** @} *********************************************************************/
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
|
@ -768,7 +796,7 @@ protected:
|
|||
int init(const class NdbTableImpl*, NdbTransaction* aCon);
|
||||
void initInterpreter();
|
||||
|
||||
NdbOperation(Ndb* aNdb);
|
||||
NdbOperation(Ndb* aNdb, Type aType = PrimaryKeyAccess);
|
||||
virtual ~NdbOperation();
|
||||
void next(NdbOperation*); // Set next pointer
|
||||
NdbOperation* next(); // Get next pointer
|
||||
|
@ -881,6 +909,8 @@ protected:
|
|||
* These are the private variables that are defined in the operation objects.
|
||||
*****************************************************************************/
|
||||
|
||||
Type m_type;
|
||||
|
||||
NdbReceiver theReceiver;
|
||||
|
||||
NdbError theError; // Errorcode
|
||||
|
@ -1043,6 +1073,19 @@ NdbOperation::getFirstRecAttr() const
|
|||
return theReceiver.theFirstRecAttr;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
Type getType()
|
||||
|
||||
Return Value Return the Type.
|
||||
Remark: Gets type of access.
|
||||
******************************************************************************/
|
||||
inline
|
||||
const NdbOperation::Type
|
||||
NdbOperation::getType() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
OperationStatus Status();
|
||||
|
||||
|
|
|
@ -177,7 +177,8 @@ public:
|
|||
int restart(bool forceSend = false);
|
||||
|
||||
protected:
|
||||
NdbScanOperation(Ndb* aNdb);
|
||||
NdbScanOperation(Ndb* aNdb,
|
||||
NdbOperation::Type aType = NdbOperation::TableScan);
|
||||
virtual ~NdbScanOperation();
|
||||
|
||||
int nextResultImpl(bool fetchAllowed = true, bool forceSend = false);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <signaldata/IndxAttrInfo.hpp>
|
||||
|
||||
NdbIndexOperation::NdbIndexOperation(Ndb* aNdb) :
|
||||
NdbOperation(aNdb),
|
||||
NdbOperation(aNdb, NdbOperation::UniqueIndexAccess),
|
||||
m_theIndex(NULL)
|
||||
{
|
||||
m_tcReqGSN = GSN_TCINDXREQ;
|
||||
|
@ -164,6 +164,12 @@ int NdbIndexOperation::interpretedDeleteTuple()
|
|||
return NdbOperation::interpretedDeleteTuple();
|
||||
}
|
||||
|
||||
const NdbDictionary::Index*
|
||||
NdbIndexOperation::getIndex() const
|
||||
{
|
||||
return m_theIndex;
|
||||
}
|
||||
|
||||
int
|
||||
NdbIndexOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransactionId)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
* aTable: Pointers to the Table object
|
||||
* Remark: Creat an object of NdbOperation.
|
||||
****************************************************************************/
|
||||
NdbOperation::NdbOperation(Ndb* aNdb) :
|
||||
NdbOperation::NdbOperation(Ndb* aNdb, NdbOperation::Type aType) :
|
||||
m_type(aType),
|
||||
theReceiver(aNdb),
|
||||
theErrorLine(0),
|
||||
theNdb(aNdb),
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
|
||||
#define DEBUG_NEXT_RESULT 0
|
||||
|
||||
NdbScanOperation::NdbScanOperation(Ndb* aNdb) :
|
||||
NdbOperation(aNdb),
|
||||
NdbScanOperation::NdbScanOperation(Ndb* aNdb, NdbOperation::Type aType) :
|
||||
NdbOperation(aNdb, aType),
|
||||
m_transConnection(NULL)
|
||||
{
|
||||
theParallelism = 0;
|
||||
|
@ -1012,7 +1012,7 @@ NdbScanOperation::getBlobHandle(Uint32 anAttrId)
|
|||
}
|
||||
|
||||
NdbIndexScanOperation::NdbIndexScanOperation(Ndb* aNdb)
|
||||
: NdbScanOperation(aNdb)
|
||||
: NdbScanOperation(aNdb, NdbOperation::OrderedIndexScan)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -1171,6 +1171,8 @@ NdbTransaction::getNdbIndexScanOperation(const NdbIndexImpl* index,
|
|||
{
|
||||
tOp->m_currentTable = table;
|
||||
}
|
||||
// Mark that this really an NdbIndexScanOperation
|
||||
tOp->m_type = NdbOperation::OrderedIndexScan;
|
||||
return tOp;
|
||||
} else {
|
||||
setOperationErrorCodeAbort(4271);
|
||||
|
@ -1232,6 +1234,8 @@ NdbTransaction::getNdbScanOperation(const NdbTableImpl * tab)
|
|||
|
||||
if (tOp->init(tab, this) != -1) {
|
||||
define_scan_op(tOp);
|
||||
// Mark that this NdbIndexScanOperation is used as NdbScanOperation
|
||||
tOp->m_type = NdbOperation::TableScan;
|
||||
return tOp;
|
||||
} else {
|
||||
theNdb->releaseScanOperation(tOp);
|
||||
|
|
|
@ -1428,7 +1428,13 @@ mysql_init(MYSQL *mysql)
|
|||
mysql->free_me=1;
|
||||
}
|
||||
else
|
||||
bzero((char*) (mysql),sizeof(*(mysql)));
|
||||
{
|
||||
#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
|
||||
bzero((char*) (mysql), sizeof(*(mysql)));
|
||||
#else
|
||||
bzero((char*) (mysql), offsetof(MYSQL, info_buffer));
|
||||
#endif
|
||||
}
|
||||
mysql->options.connect_timeout= CONNECT_TIMEOUT;
|
||||
mysql->last_used_con= mysql->next_slave= mysql->master = mysql;
|
||||
mysql->charset=default_charset_info;
|
||||
|
@ -2341,9 +2347,12 @@ static void mysql_close_free(MYSQL *mysql)
|
|||
my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR));
|
||||
#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
|
||||
my_free(mysql->info_buffer,MYF(MY_ALLOW_ZERO_PTR));
|
||||
mysql->info_buffer= 0;
|
||||
#endif
|
||||
/* Clear pointers for better safety */
|
||||
mysql->info_buffer=mysql->host_info=mysql->user=mysql->passwd=mysql->db=0;
|
||||
mysql->host_info= mysql->user= mysql->passwd= mysql->db= 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -153,10 +153,11 @@ sql_yacc.o: sql_yacc.cc sql_yacc.h $(HEADERS)
|
|||
lex_hash.h: gen_lex_hash$(EXEEXT)
|
||||
./gen_lex_hash$(EXEEXT) > $@
|
||||
|
||||
# For testing of udf_example.so; Works on platforms with gcc
|
||||
# (This is not part of our build process but only provided as an example)
|
||||
udf_example.so: udf_example.cc
|
||||
$(CXXCOMPILE) -shared -o $@ $<
|
||||
# For testing of udf_example.so
|
||||
noinst_LTLIBRARIES= udf_example.la
|
||||
udf_example_la_SOURCES= udf_example.cc
|
||||
udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
|
||||
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
|
|
@ -1031,6 +1031,7 @@ int ha_ndbcluster::build_index_list(Ndb *ndb, TABLE *tab, enum ILBP phase)
|
|||
NDBDICT *dict= ndb->getDictionary();
|
||||
DBUG_ENTER("ha_ndbcluster::build_index_list");
|
||||
|
||||
m_has_unique_index= FALSE;
|
||||
// Save information about all known indexes
|
||||
for (i= 0; i < tab->s->keys; i++, key_info++, key_name++)
|
||||
{
|
||||
|
@ -1039,6 +1040,7 @@ int ha_ndbcluster::build_index_list(Ndb *ndb, TABLE *tab, enum ILBP phase)
|
|||
m_index[i].type= idx_type;
|
||||
if (idx_type == UNIQUE_ORDERED_INDEX || idx_type == UNIQUE_INDEX)
|
||||
{
|
||||
m_has_unique_index= TRUE;
|
||||
strxnmov(unique_index_name, FN_LEN, index_name, unique_suffix, NullS);
|
||||
DBUG_PRINT("info", ("Created unique index name \'%s\' for index %d",
|
||||
unique_index_name, i));
|
||||
|
@ -1290,6 +1292,24 @@ int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const byte *rec
|
|||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
int ha_ndbcluster::set_index_key_from_record(NdbOperation *op, const byte *record, uint keyno)
|
||||
{
|
||||
KEY* key_info= table->key_info + keyno;
|
||||
KEY_PART_INFO* key_part= key_info->key_part;
|
||||
KEY_PART_INFO* end= key_part+key_info->key_parts;
|
||||
uint i;
|
||||
DBUG_ENTER("set_index_key_from_record");
|
||||
|
||||
for (i= 0; key_part != end; key_part++, i++)
|
||||
{
|
||||
Field* field= key_part->field;
|
||||
if (set_ndb_key(op, field, m_index[keyno].unique_index_attrid_map[i],
|
||||
record+key_part->offset))
|
||||
ERR_RETURN(m_active_trans->getNdbError());
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
int
|
||||
ha_ndbcluster::set_index_key(NdbOperation *op,
|
||||
const KEY *key_info,
|
||||
|
@ -1443,7 +1463,6 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data)
|
|||
ERR_RETURN(trans->getNdbError());
|
||||
}
|
||||
}
|
||||
|
||||
if (execute_no_commit(this,trans) != 0)
|
||||
{
|
||||
table->status= STATUS_NOT_FOUND;
|
||||
|
@ -1471,30 +1490,136 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data)
|
|||
}
|
||||
|
||||
/*
|
||||
Peek to check if a particular row already exists
|
||||
* Check that all operations between first and last all
|
||||
* have gotten the errcode
|
||||
* If checking for HA_ERR_KEY_NOT_FOUND then update m_dupkey
|
||||
* for all succeeding operations
|
||||
*/
|
||||
bool ha_ndbcluster::check_all_operations_for_error(NdbTransaction *trans,
|
||||
const NdbOperation *first,
|
||||
const NdbOperation *last,
|
||||
uint errcode)
|
||||
{
|
||||
const NdbOperation *op= first;
|
||||
DBUG_ENTER("ha_ndbcluster::check_all_operations_for_error");
|
||||
|
||||
while(op)
|
||||
{
|
||||
NdbError err= op->getNdbError();
|
||||
if (err.status != NdbError::Success)
|
||||
{
|
||||
if (ndb_to_mysql_error(&err) != (int) errcode)
|
||||
DBUG_RETURN(false);
|
||||
if (op == last) break;
|
||||
op= trans->getNextCompletedOperation(op);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We found a duplicate
|
||||
if (op->getType() == NdbOperation::UniqueIndexAccess)
|
||||
{
|
||||
if (errcode == HA_ERR_KEY_NOT_FOUND)
|
||||
{
|
||||
NdbIndexOperation *iop= (NdbIndexOperation *) op;
|
||||
const NDBINDEX *index= iop->getIndex();
|
||||
// Find the key_no of the index
|
||||
for(uint i= 0; i<table->s->keys; i++)
|
||||
{
|
||||
if (m_index[i].unique_index == index)
|
||||
{
|
||||
m_dupkey= i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Must have been primary key access
|
||||
DBUG_ASSERT(op->getType() == NdbOperation::PrimaryKeyAccess);
|
||||
if (errcode == HA_ERR_KEY_NOT_FOUND)
|
||||
m_dupkey= table->s->primary_key;
|
||||
}
|
||||
DBUG_RETURN(false);
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Peek to check if any rows already exist with conflicting
|
||||
* primary key or unique index values
|
||||
*/
|
||||
|
||||
int ha_ndbcluster::peek_row(const byte *record)
|
||||
int ha_ndbcluster::peek_indexed_rows(const byte *record)
|
||||
{
|
||||
NdbTransaction *trans= m_active_trans;
|
||||
NdbOperation *op;
|
||||
DBUG_ENTER("peek_row");
|
||||
|
||||
NdbOperation::LockMode lm=
|
||||
(NdbOperation::LockMode)get_ndb_lock_type(m_lock.type);
|
||||
if (!(op= trans->getNdbOperation((const NDBTAB *) m_table)) ||
|
||||
op->readTuple(lm) != 0)
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
|
||||
const NdbOperation *first, *last;
|
||||
uint i;
|
||||
int res;
|
||||
if ((res= set_primary_key_from_record(op, record)))
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
DBUG_ENTER("peek_indexed_rows");
|
||||
|
||||
if (execute_no_commit_ie(this,trans) != 0)
|
||||
NdbOperation::LockMode lm= NdbOperation::LM_Read;
|
||||
first= NULL;
|
||||
if (table->s->primary_key != MAX_KEY)
|
||||
{
|
||||
/*
|
||||
* Fetch any row with colliding primary key
|
||||
*/
|
||||
if (!(op= trans->getNdbOperation((const NDBTAB *) m_table)) ||
|
||||
op->readTuple(lm) != 0)
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
|
||||
first= op;
|
||||
if ((res= set_primary_key_from_record(op, record)))
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
}
|
||||
/*
|
||||
* Fetch any rows with colliding unique indexes
|
||||
*/
|
||||
KEY* key_info;
|
||||
KEY_PART_INFO *key_part, *end;
|
||||
for (i= 0, key_info= table->key_info; i < table->s->keys; i++, key_info++)
|
||||
{
|
||||
if (i != table->s->primary_key &&
|
||||
key_info->flags & HA_NOSAME)
|
||||
{
|
||||
// A unique index is defined on table
|
||||
NdbIndexOperation *iop;
|
||||
NDBINDEX *unique_index = (NDBINDEX *) m_index[i].unique_index;
|
||||
key_part= key_info->key_part;
|
||||
end= key_part + key_info->key_parts;
|
||||
if (!(iop= trans->getNdbIndexOperation(unique_index,
|
||||
(const NDBTAB *) m_table)) ||
|
||||
iop->readTuple(lm) != 0)
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
|
||||
if (!first)
|
||||
first= iop;
|
||||
if ((res= set_index_key_from_record(iop, record, i)))
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
}
|
||||
}
|
||||
last= trans->getLastDefinedOperation();
|
||||
if (first)
|
||||
res= execute_no_commit_ie(this,trans);
|
||||
else
|
||||
{
|
||||
// Table has no keys
|
||||
table->status= STATUS_NOT_FOUND;
|
||||
DBUG_RETURN(HA_ERR_KEY_NOT_FOUND);
|
||||
}
|
||||
if (check_all_operations_for_error(trans, first, last,
|
||||
HA_ERR_KEY_NOT_FOUND))
|
||||
{
|
||||
table->status= STATUS_NOT_FOUND;
|
||||
DBUG_RETURN(ndb_err(trans));
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_PRINT("info", ("m_dupkey %d", m_dupkey));
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -1930,13 +2055,33 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
|
||||
DBUG_ENTER("write_row");
|
||||
|
||||
if (m_ignore_dup_key && table->s->primary_key != MAX_KEY)
|
||||
has_auto_increment= (table->next_number_field && record == table->record[0]);
|
||||
if (table->s->primary_key != MAX_KEY)
|
||||
{
|
||||
int peek_res= peek_row(record);
|
||||
/*
|
||||
* Increase any auto_incremented primary key
|
||||
*/
|
||||
if (has_auto_increment)
|
||||
{
|
||||
THD *thd= table->in_use;
|
||||
|
||||
m_skip_auto_increment= FALSE;
|
||||
update_auto_increment();
|
||||
/* Ensure that handler is always called for auto_increment values */
|
||||
thd->next_insert_id= 0;
|
||||
m_skip_auto_increment= !auto_increment_column_changed;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If IGNORE the ignore constraint violations on primary and unique keys
|
||||
*/
|
||||
if (!m_use_write && m_ignore_dup_key)
|
||||
{
|
||||
int peek_res= peek_indexed_rows(record);
|
||||
|
||||
if (!peek_res)
|
||||
{
|
||||
m_dupkey= table->s->primary_key;
|
||||
DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY);
|
||||
}
|
||||
if (peek_res != HA_ERR_KEY_NOT_FOUND)
|
||||
|
@ -1946,7 +2091,6 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
statistic_increment(thd->status_var.ha_write_count, &LOCK_status);
|
||||
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
|
||||
table->timestamp_field->set_time();
|
||||
has_auto_increment= (table->next_number_field && record == table->record[0]);
|
||||
|
||||
if (!(op= trans->getNdbOperation((const NDBTAB *) m_table)))
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
|
@ -1975,17 +2119,6 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
{
|
||||
int res;
|
||||
|
||||
if (has_auto_increment)
|
||||
{
|
||||
THD *thd= table->in_use;
|
||||
|
||||
m_skip_auto_increment= FALSE;
|
||||
update_auto_increment();
|
||||
/* Ensure that handler is always called for auto_increment values */
|
||||
thd->next_insert_id= 0;
|
||||
m_skip_auto_increment= !auto_increment_column_changed;
|
||||
}
|
||||
|
||||
if ((res= set_primary_key_from_record(op, record)))
|
||||
return res;
|
||||
}
|
||||
|
@ -2996,7 +3129,7 @@ int ha_ndbcluster::extra(enum ha_extra_function operation)
|
|||
break;
|
||||
case HA_EXTRA_IGNORE_DUP_KEY: /* Dup keys don't rollback everything*/
|
||||
DBUG_PRINT("info", ("HA_EXTRA_IGNORE_DUP_KEY"));
|
||||
if (current_thd->lex->sql_command == SQLCOM_REPLACE)
|
||||
if (current_thd->lex->sql_command == SQLCOM_REPLACE && !m_has_unique_index)
|
||||
{
|
||||
DBUG_PRINT("info", ("Turning ON use of write instead of insert"));
|
||||
m_use_write= TRUE;
|
||||
|
@ -4260,6 +4393,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
|
|||
m_share(0),
|
||||
m_use_write(FALSE),
|
||||
m_ignore_dup_key(FALSE),
|
||||
m_has_unique_index(FALSE),
|
||||
m_primary_key_update(FALSE),
|
||||
m_retrieve_all_fields(FALSE),
|
||||
m_retrieve_primary_key(FALSE),
|
||||
|
|
|
@ -597,7 +597,11 @@ private:
|
|||
|
||||
int pk_read(const byte *key, uint key_len, byte *buf);
|
||||
int complemented_pk_read(const byte *old_data, byte *new_data);
|
||||
int peek_row(const byte *record);
|
||||
bool check_all_operations_for_error(NdbTransaction *trans,
|
||||
const NdbOperation *first,
|
||||
const NdbOperation *last,
|
||||
uint errcode);
|
||||
int peek_indexed_rows(const byte *record);
|
||||
int unique_index_read(const byte *key, uint key_len,
|
||||
byte *buf);
|
||||
int ordered_index_scan(const key_range *start_key,
|
||||
|
@ -627,6 +631,8 @@ private:
|
|||
int get_ndb_blobs_value(NdbBlob *last_ndb_blob);
|
||||
int set_primary_key(NdbOperation *op, const byte *key);
|
||||
int set_primary_key_from_record(NdbOperation *op, const byte *record);
|
||||
int set_index_key_from_record(NdbOperation *op, const byte *record,
|
||||
uint keyno);
|
||||
int set_bounds(NdbIndexScanOperation*, const key_range *keys[2], uint= 0);
|
||||
int key_cmp(uint keynr, const byte * old_row, const byte * new_row);
|
||||
int set_index_key(NdbOperation *, const KEY *key_info, const byte *key_ptr);
|
||||
|
@ -686,6 +692,7 @@ private:
|
|||
byte m_ref[NDB_HIDDEN_PRIMARY_KEY_LENGTH];
|
||||
bool m_use_write;
|
||||
bool m_ignore_dup_key;
|
||||
bool m_has_unique_index;
|
||||
bool m_primary_key_update;
|
||||
bool m_retrieve_all_fields;
|
||||
bool m_retrieve_primary_key;
|
||||
|
|
19
sql/item.cc
19
sql/item.cc
|
@ -2642,25 +2642,8 @@ const String *Item_param::query_val_str(String* str) const
|
|||
case STRING_VALUE:
|
||||
case LONG_DATA_VALUE:
|
||||
{
|
||||
char *buf, *ptr;
|
||||
str->length(0);
|
||||
if (str->reserve(str_value.length()*2+3))
|
||||
break;
|
||||
|
||||
buf= str->c_ptr_quick();
|
||||
ptr= buf;
|
||||
if (value.cs_info.character_set_client->escape_with_backslash_is_dangerous)
|
||||
{
|
||||
ptr= str_to_hex(ptr, str_value.ptr(), str_value.length());
|
||||
}
|
||||
else
|
||||
{
|
||||
*ptr++= '\'';
|
||||
ptr+= escape_string_for_mysql(str_value.charset(), ptr, 0,
|
||||
str_value.ptr(), str_value.length());
|
||||
*ptr++='\'';
|
||||
}
|
||||
str->length((uint32) (ptr - buf));
|
||||
append_query_string(value.cs_info.character_set_client, &str_value, str);
|
||||
break;
|
||||
}
|
||||
case NULL_VALUE:
|
||||
|
|
|
@ -2606,7 +2606,7 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
|
|||
switch(arguments[i]->type()) {
|
||||
case Item::STRING_ITEM: // Constant string !
|
||||
{
|
||||
String *res=arguments[i]->val_str((String *) 0);
|
||||
String *res=arguments[i]->val_str(&buffers[i]);
|
||||
if (arguments[i]->null_value)
|
||||
continue;
|
||||
f_args.args[i]= (char*) res->ptr();
|
||||
|
@ -2805,9 +2805,6 @@ longlong Item_func_udf_int::val_int()
|
|||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
DBUG_ENTER("Item_func_udf_int::val_int");
|
||||
DBUG_PRINT("info",("result_type: %d arg_count: %d",
|
||||
args[0]->result_type(), arg_count));
|
||||
|
||||
DBUG_RETURN(udf.val_int(&null_value));
|
||||
}
|
||||
|
||||
|
|
|
@ -239,6 +239,37 @@ char *str_to_hex(char *to, const char *from, uint len)
|
|||
return to; // pointer to end 0 of 'to'
|
||||
}
|
||||
|
||||
/*
|
||||
Append a version of the 'from' string suitable for use in a query to
|
||||
the 'to' string. To generate a correct escaping, the character set
|
||||
information in 'csinfo' is used.
|
||||
*/
|
||||
#ifndef MYSQL_CLIENT
|
||||
int
|
||||
append_query_string(CHARSET_INFO *csinfo,
|
||||
String const *from, String *to)
|
||||
{
|
||||
char *beg, *ptr;
|
||||
uint32 const orig_len= to->length();
|
||||
if (to->reserve(orig_len + from->length()*2+3))
|
||||
return 1;
|
||||
|
||||
beg= to->c_ptr_quick() + to->length();
|
||||
ptr= beg;
|
||||
if (csinfo->escape_with_backslash_is_dangerous)
|
||||
ptr= str_to_hex(ptr, from->ptr(), from->length());
|
||||
else
|
||||
{
|
||||
*ptr++= '\'';
|
||||
ptr+= escape_string_for_mysql(from->charset(), ptr, 0,
|
||||
from->ptr(), from->length());
|
||||
*ptr++='\'';
|
||||
}
|
||||
to->length(orig_len + ptr - beg);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
Prints a "session_var=value" string. Used by mysqlbinlog to print some SET
|
||||
commands just before it prints a query.
|
||||
|
|
|
@ -529,6 +529,8 @@ bool delete_precheck(THD *thd, TABLE_LIST *tables);
|
|||
bool insert_precheck(THD *thd, TABLE_LIST *tables);
|
||||
bool create_table_precheck(THD *thd, TABLE_LIST *tables,
|
||||
TABLE_LIST *create_table);
|
||||
int append_query_string(CHARSET_INFO *csinfo,
|
||||
String const *from, String *to);
|
||||
|
||||
void get_default_definer(THD *thd, LEX_USER *definer);
|
||||
LEX_USER *create_default_definer(THD *thd);
|
||||
|
|
|
@ -3604,9 +3604,18 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond)
|
|||
/* Here when simple cond */
|
||||
if (cond->const_item())
|
||||
{
|
||||
if (cond->val_int())
|
||||
DBUG_RETURN(new SEL_TREE(SEL_TREE::ALWAYS));
|
||||
DBUG_RETURN(new SEL_TREE(SEL_TREE::IMPOSSIBLE));
|
||||
/*
|
||||
During the cond->val_int() evaluation we can come across a subselect
|
||||
item which may allocate memory on the thd->mem_root and assumes
|
||||
all the memory allocated has the same life span as the subselect
|
||||
item itself. So we have to restore the thread's mem_root here.
|
||||
*/
|
||||
MEM_ROOT *tmp_root= param->mem_root;
|
||||
param->thd->mem_root= param->old_root;
|
||||
tree= cond->val_int() ? new(tmp_root) SEL_TREE(SEL_TREE::ALWAYS) :
|
||||
new(tmp_root) SEL_TREE(SEL_TREE::IMPOSSIBLE);
|
||||
param->thd->mem_root= tmp_root;
|
||||
DBUG_RETURN(tree);
|
||||
}
|
||||
|
||||
table_map ref_tables= 0;
|
||||
|
|
|
@ -746,7 +746,6 @@ File_parser::parse(gptr base, MEM_ROOT *mem_root,
|
|||
char *eol;
|
||||
LEX_STRING *str;
|
||||
List<LEX_STRING> *list;
|
||||
ulonglong *num;
|
||||
DBUG_ENTER("File_parser::parse");
|
||||
|
||||
while (ptr < end && found < required)
|
||||
|
|
|
@ -2978,23 +2978,23 @@ ER_UDF_EXISTS
|
|||
swe "Funktionen '%-.64s' finns redan"
|
||||
ukr "æÕÎËÃ¦Ñ '%-.64s' ×ÖÅ ¦ÓÎÕ¤"
|
||||
ER_CANT_OPEN_LIBRARY
|
||||
cze "Nemohu otev-Bøít sdílenou knihovnu '%-.64s' (errno: %d %s)"
|
||||
dan "Kan ikke åbne delt bibliotek '%-.64s' (errno: %d %s)"
|
||||
nla "Kan shared library '%-.64s' niet openen (Errcode: %d %s)"
|
||||
eng "Can't open shared library '%-.64s' (errno: %d %-.64s)"
|
||||
jps "shared library '%-.64s' ‚ðŠJ‚Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d %s)",
|
||||
est "Ei suuda avada jagatud teeki '%-.64s' (veakood: %d %-.64s)"
|
||||
fre "Impossible d'ouvrir la bibliothèque partagée '%-.64s' (errno: %d %s)"
|
||||
ger "Kann Shared Library '%-.64s' nicht öffnen (Fehler: %d %-.64s)"
|
||||
greek "Äåí åßíáé äõíáôÞ ç áíÜãíùóç ôçò shared library '%-.64s' (êùäéêüò ëÜèïõò: %d %s)"
|
||||
hun "A(z) '%-.64s' megosztott konyvtar nem hasznalhato (hibakod: %d %s)"
|
||||
ita "Impossibile aprire la libreria condivisa '%-.64s' (errno: %d %s)"
|
||||
jpn "shared library '%-.64s' ¤ò³«¤¯»ö¤¬¤Ç¤¤Þ¤»¤ó (errno: %d %s)"
|
||||
kor "'%-.64s' °øÀ¯ ¶óÀ̹ö·¯¸®¸¦ ¿¼ö ¾ø½À´Ï´Ù.(¿¡·¯¹øÈ£: %d %s)"
|
||||
nor "Can't open shared library '%-.64s' (errno: %d %s)"
|
||||
norwegian-ny "Can't open shared library '%-.64s' (errno: %d %s)"
|
||||
pol "Can't open shared library '%-.64s' (errno: %d %s)"
|
||||
por "Não pode abrir biblioteca compartilhada '%-.64s' (erro no. '%d' - '%-.64s')"
|
||||
cze "Nemohu otev-Bøít sdílenou knihovnu '%-.64s' (errno: %d %-.128s)"
|
||||
dan "Kan ikke åbne delt bibliotek '%-.64s' (errno: %d %-.128s)"
|
||||
nla "Kan shared library '%-.64s' niet openen (Errcode: %d %-.128s)"
|
||||
eng "Can't open shared library '%-.64s' (errno: %d %-.128s)"
|
||||
jps "shared library '%-.64s' ‚ðŠJ‚Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d %-.128s)",
|
||||
est "Ei suuda avada jagatud teeki '%-.64s' (veakood: %d %-.128s)"
|
||||
fre "Impossible d'ouvrir la bibliothèque partagée '%-.64s' (errno: %d %-.128s)"
|
||||
ger "Kann Shared Library '%-.64s' nicht öffnen (Fehler: %d %-.128s)"
|
||||
greek "Äåí åßíáé äõíáôÞ ç áíÜãíùóç ôçò shared library '%-.64s' (êùäéêüò ëÜèïõò: %d %-.128s)"
|
||||
hun "A(z) '%-.64s' megosztott konyvtar nem hasznalhato (hibakod: %d %-.128s)"
|
||||
ita "Impossibile aprire la libreria condivisa '%-.64s' (errno: %d %-.128s)"
|
||||
jpn "shared library '%-.64s' ¤ò³«¤¯»ö¤¬¤Ç¤¤Þ¤»¤ó (errno: %d %-.128s)"
|
||||
kor "'%-.64s' °øÀ¯ ¶óÀ̹ö·¯¸®¸¦ ¿¼ö ¾ø½À´Ï´Ù.(¿¡·¯¹øÈ£: %d %-.128s)"
|
||||
nor "Can't open shared library '%-.64s' (errno: %d %-.128s)"
|
||||
norwegian-ny "Can't open shared library '%-.64s' (errno: %d %-.128s)"
|
||||
pol "Can't open shared library '%-.64s' (errno: %d %-.128s)"
|
||||
por "Não pode abrir biblioteca compartilhada '%-.64s' (erro no. '%d' - '%-.128s')"
|
||||
rum "Nu pot deschide libraria shared '%-.64s' (Eroare: %d %-.64s)"
|
||||
rus "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÄÉÎÁÍÉÞÅÓËÕÀ ÂÉÂÌÉÏÔÅËÕ '%-.64s' (ÏÛÉÂËÁ: %d %-.64s)"
|
||||
serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.64s' (errno: %d %-.64s)"
|
||||
|
@ -3003,27 +3003,27 @@ ER_CANT_OPEN_LIBRARY
|
|||
swe "Kan inte öppna det dynamiska biblioteket '%-.64s' (Felkod: %d %s)"
|
||||
ukr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÒÏÚĦÌÀ×ÁÎÕ Â¦Â̦ÏÔÅËÕ '%-.64s' (ÐÏÍÉÌËÁ: %d %-.64s)"
|
||||
ER_CANT_FIND_DL_ENTRY
|
||||
cze "Nemohu naj-Bít funkci '%-.64s' v knihovnì"
|
||||
dan "Kan ikke finde funktionen '%-.64s' i bibliotek"
|
||||
nla "Kan functie '%-.64s' niet in library vinden"
|
||||
eng "Can't find function '%-.64s' in library"
|
||||
jps "function '%-.64s' ‚ðƒ‰ƒCƒuƒ‰ƒŠ<C692>[’†‚ÉŒ©•t‚¯‚鎖‚ª‚Å‚«‚Ü‚¹‚ñ",
|
||||
est "Ei leia funktsiooni '%-.64s' antud teegis"
|
||||
fre "Impossible de trouver la fonction '%-.64s' dans la bibliothèque"
|
||||
ger "Kann Funktion '%-.64s' in der Library nicht finden"
|
||||
greek "Äåí åßíáé äõíáôÞ ç áíåýñåóç ôçò óõíÜñôçóçò '%-.64s' óôçí âéâëéïèÞêç"
|
||||
hun "A(z) '%-.64s' fuggveny nem talalhato a konyvtarban"
|
||||
ita "Impossibile trovare la funzione '%-.64s' nella libreria"
|
||||
jpn "function '%-.64s' ¤ò¥é¥¤¥Ö¥é¥ê¡¼Ãæ¤Ë¸«ÉÕ¤±¤ë»ö¤¬¤Ç¤¤Þ¤»¤ó"
|
||||
kor "¶óÀ̹ö·¯¸®¿¡¼ '%-.64s' ÇÔ¼ö¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù."
|
||||
por "Não pode encontrar a função '%-.64s' na biblioteca"
|
||||
rum "Nu pot gasi functia '%-.64s' in libraria"
|
||||
rus "îÅ×ÏÚÍÏÖÎÏ ÏÔÙÓËÁÔØ ÆÕÎËÃÉÀ '%-.64s' × ÂÉÂÌÉÏÔÅËÅ"
|
||||
serbian "Ne mogu da pronadjem funkciju '%-.64s' u biblioteci"
|
||||
slo "Nemô¾em nájs» funkciu '%-.64s' v kni¾nici"
|
||||
spa "No puedo encontrar función '%-.64s' en libraria"
|
||||
swe "Hittar inte funktionen '%-.64s' in det dynamiska biblioteket"
|
||||
ukr "îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÆÕÎËæÀ '%-.64s' Õ Â¦Â̦ÏÔÅæ"
|
||||
cze "Nemohu naj-Bít funkci '%-.128s' v knihovnì"
|
||||
dan "Kan ikke finde funktionen '%-.128s' i bibliotek"
|
||||
nla "Kan functie '%-.128s' niet in library vinden"
|
||||
eng "Can't find function '%-.128s' in library"
|
||||
jps "function '%-.128s' ‚ðƒ‰ƒCƒuƒ‰ƒŠ<C692>[’†‚ÉŒ©•t‚¯‚鎖‚ª‚Å‚«‚Ü‚¹‚ñ",
|
||||
est "Ei leia funktsiooni '%-.128s' antud teegis"
|
||||
fre "Impossible de trouver la fonction '%-.128s' dans la bibliothèque"
|
||||
ger "Kann Funktion '%-.128s' in der Library nicht finden"
|
||||
greek "Äåí åßíáé äõíáôÞ ç áíåýñåóç ôçò óõíÜñôçóçò '%-.128s' óôçí âéâëéïèÞêç"
|
||||
hun "A(z) '%-.128s' fuggveny nem talalhato a konyvtarban"
|
||||
ita "Impossibile trovare la funzione '%-.128s' nella libreria"
|
||||
jpn "function '%-.128s' ¤ò¥é¥¤¥Ö¥é¥ê¡¼Ãæ¤Ë¸«ÉÕ¤±¤ë»ö¤¬¤Ç¤¤Þ¤»¤ó"
|
||||
kor "¶óÀ̹ö·¯¸®¿¡¼ '%-.128s' ÇÔ¼ö¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù."
|
||||
por "Não pode encontrar a função '%-.128s' na biblioteca"
|
||||
rum "Nu pot gasi functia '%-.128s' in libraria"
|
||||
rus "îÅ×ÏÚÍÏÖÎÏ ÏÔÙÓËÁÔØ ÆÕÎËÃÉÀ '%-.128s' × ÂÉÂÌÉÏÔÅËÅ"
|
||||
serbian "Ne mogu da pronadjem funkciju '%-.128s' u biblioteci"
|
||||
slo "Nemô¾em nájs» funkciu '%-.128s' v kni¾nici"
|
||||
spa "No puedo encontrar función '%-.128s' en libraria"
|
||||
swe "Hittar inte funktionen '%-.128s' in det dynamiska biblioteket"
|
||||
ukr "îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÆÕÎËæÀ '%-.128s' Õ Â¦Â̦ÏÔÅæ"
|
||||
ER_FUNCTION_NOT_DEFINED
|
||||
cze "Funkce '%-.64s' nen-Bí definována"
|
||||
dan "Funktionen '%-.64s' er ikke defineret"
|
||||
|
|
|
@ -80,8 +80,8 @@ sp_map_item_type(enum enum_field_types type)
|
|||
/*
|
||||
Return a string representation of the Item value.
|
||||
|
||||
NOTE: this is a legacy-compatible implementation. It fails if the value
|
||||
contains non-ordinary symbols, which should be escaped.
|
||||
NOTE: If the item has a string result type, the string is escaped
|
||||
according to its character set.
|
||||
|
||||
SYNOPSIS
|
||||
item a pointer to the Item
|
||||
|
@ -119,9 +119,9 @@ sp_get_item_value(Item *item, String *str)
|
|||
|
||||
buf.append('_');
|
||||
buf.append(result->charset()->csname);
|
||||
buf.append('\'');
|
||||
buf.append(*result);
|
||||
buf.append('\'');
|
||||
if (result->charset()->escape_with_backslash_is_dangerous)
|
||||
buf.append(' ');
|
||||
append_query_string(result->charset(), result, &buf);
|
||||
str->copy(buf);
|
||||
|
||||
return str;
|
||||
|
|
|
@ -108,6 +108,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
|
|||
{
|
||||
MYSQL_ERROR *err= 0;
|
||||
DBUG_ENTER("push_warning");
|
||||
DBUG_PRINT("enter", ("code: %d, msg: %s", code, msg));
|
||||
|
||||
if (level == MYSQL_ERROR::WARN_LEVEL_NOTE &&
|
||||
!(thd->options & OPTION_SQL_NOTES))
|
||||
|
|
|
@ -819,8 +819,18 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
|||
from++;
|
||||
wc= '?';
|
||||
}
|
||||
else if (cnvres > MY_CS_TOOSMALL)
|
||||
{
|
||||
/*
|
||||
A correct multibyte sequence detected
|
||||
But it doesn't have Unicode mapping.
|
||||
*/
|
||||
error_count++;
|
||||
from+= (-cnvres);
|
||||
wc= '?';
|
||||
}
|
||||
else
|
||||
break; // Impossible char.
|
||||
break; // Not enough characters
|
||||
|
||||
outp:
|
||||
if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
|
||||
|
|
|
@ -439,6 +439,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
|
|||
}
|
||||
if (!(dl = find_udf_dl(udf->dl)))
|
||||
{
|
||||
DBUG_PRINT("info", ("Calling dlopen, udf->dl: %s", udf->dl));
|
||||
if (!(dl = dlopen(udf->dl, RTLD_NOW)))
|
||||
{
|
||||
DBUG_PRINT("error",("dlopen of %s failed, error: %d (%s)",
|
||||
|
|
|
@ -1597,7 +1597,7 @@ bool check_db_name(char *name)
|
|||
while (*name)
|
||||
{
|
||||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||
last_char_is_space= my_isspace(default_charset_info, *name);
|
||||
last_char_is_space= my_isspace(system_charset_info, *name);
|
||||
if (use_mb(system_charset_info))
|
||||
{
|
||||
int len=my_ismbchar(system_charset_info, name,
|
||||
|
@ -1643,7 +1643,7 @@ bool check_table_name(const char *name, uint length)
|
|||
while (name != end)
|
||||
{
|
||||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||
last_char_is_space= my_isspace(default_charset_info, *name);
|
||||
last_char_is_space= my_isspace(system_charset_info, *name);
|
||||
if (use_mb(system_charset_info))
|
||||
{
|
||||
int len=my_ismbchar(system_charset_info, name, end);
|
||||
|
@ -1674,7 +1674,7 @@ bool check_column_name(const char *name)
|
|||
while (*name)
|
||||
{
|
||||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||
last_char_is_space= my_isspace(default_charset_info, *name);
|
||||
last_char_is_space= my_isspace(system_charset_info, *name);
|
||||
if (use_mb(system_charset_info))
|
||||
{
|
||||
int len=my_ismbchar(system_charset_info, name,
|
||||
|
|
|
@ -113,6 +113,8 @@
|
|||
*/
|
||||
|
||||
#ifdef STANDARD
|
||||
/* STANDARD is defined, don't use any mysql functions */
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef __WIN__
|
||||
|
@ -125,10 +127,10 @@ typedef long long longlong;
|
|||
#else
|
||||
#include <my_global.h>
|
||||
#include <my_sys.h>
|
||||
#include <m_string.h> // To get strmov()
|
||||
#endif
|
||||
#include <mysql.h>
|
||||
#include <m_ctype.h>
|
||||
#include <m_string.h> // To get strmov()
|
||||
#include <ctype.h>
|
||||
|
||||
static pthread_mutex_t LOCK_hostname;
|
||||
|
||||
|
@ -290,8 +292,8 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||
|
||||
for (n = ntrans + 1, n_end = ntrans + sizeof(ntrans)-2;
|
||||
word != w_end && n < n_end; word++ )
|
||||
if ( my_isalpha ( &my_charset_latin1, *word ))
|
||||
*n++ = my_toupper ( &my_charset_latin1, *word );
|
||||
if ( isalpha ( *word ))
|
||||
*n++ = toupper ( *word );
|
||||
|
||||
if ( n == ntrans + 1 ) /* return empty string if 0 bytes */
|
||||
{
|
||||
|
@ -519,7 +521,7 @@ my_bool myfunc_double_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
|||
{
|
||||
if (!args->arg_count)
|
||||
{
|
||||
strcpy(message,"myfunc_double must have at least on argument");
|
||||
strcpy(message,"myfunc_double must have at least one argument");
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
|
|
|
@ -6275,7 +6275,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||
int hi=s[0];
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
if (hi<0x80)
|
||||
{
|
||||
|
@ -6284,10 +6284,10 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
if (!(pwc[0]=func_big5_uni_onechar((hi<<8)+s[1])))
|
||||
return MY_CS_ILSEQ;
|
||||
return -2;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
|
|
@ -246,7 +246,7 @@ static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)),
|
|||
const unsigned char *end __attribute__((unused)))
|
||||
{
|
||||
if (str >= end)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
*wc=str[0];
|
||||
return 1;
|
||||
|
@ -295,10 +295,10 @@ void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)),
|
|||
#define INC_PTR(cs,A,B) (A)++
|
||||
|
||||
|
||||
static int my_wildcmp_bin(CHARSET_INFO *cs,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many)
|
||||
int my_wildcmp_bin(CHARSET_INFO *cs,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many)
|
||||
{
|
||||
int result= -1; /* Not found, using wildcards */
|
||||
|
||||
|
|
|
@ -5355,7 +5355,7 @@ my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
|||
int hi=s[0];
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
if (hi < 0x80)
|
||||
{
|
||||
|
@ -5370,10 +5370,10 @@ my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
if (!(pwc[0]=func_cp932_uni_onechar((hi<<8)+s[1])))
|
||||
return MY_CS_ILSEQ;
|
||||
return -2;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
|
|
@ -356,7 +356,7 @@ static int my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)),
|
|||
|
||||
#ifdef REAL_MYSQL
|
||||
|
||||
#define min_sort_char 0
|
||||
#define min_sort_char ' '
|
||||
#define max_sort_char '9'
|
||||
|
||||
#define EXAMPLE
|
||||
|
@ -595,7 +595,7 @@ static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler =
|
|||
my_strnxfrm_czech,
|
||||
my_strnxfrmlen_simple,
|
||||
my_like_range_czech,
|
||||
my_wildcmp_8bit,
|
||||
my_wildcmp_bin,
|
||||
my_strcasecmp_8bit,
|
||||
my_instr_simple,
|
||||
my_hash_sort_simple,
|
||||
|
|
|
@ -8601,7 +8601,7 @@ my_wc_mb_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
|
|||
return MY_CS_ILUNI;
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
s[0]=code>>8;
|
||||
s[1]=code&0xFF;
|
||||
|
@ -8617,7 +8617,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
|
|||
int hi=s[0];
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
if (hi<0x80)
|
||||
{
|
||||
|
@ -8626,10 +8626,10 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
if (!(pwc[0]=func_ksc5601_uni_onechar((hi<<8)+s[1])))
|
||||
return MY_CS_ILSEQ;
|
||||
return -2;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
|
|
@ -243,7 +243,7 @@ my_mb_wc_jisx0201(CHARSET_INFO *cs __attribute__((unused)),
|
|||
const uchar *e __attribute__((unused)))
|
||||
{
|
||||
wc[0]=tab_jisx0201_uni[*s];
|
||||
return (!wc[0] && s[0]) ? MY_CS_ILSEQ : 1;
|
||||
return (!wc[0] && s[0]) ? -1 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -8473,7 +8473,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
int c1,c2,c3;
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
c1=s[0];
|
||||
|
||||
|
@ -8485,7 +8485,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
}
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
c2=s[1];
|
||||
|
||||
|
@ -8500,7 +8500,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
{
|
||||
pwc[0]=my_jisx0208_uni_onechar( ((c1-0x80) << 8) + (c2-0x80));
|
||||
if (!pwc[0])
|
||||
return MY_CS_ILSEQ;
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8520,7 +8520,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
|
||||
ret = my_mb_wc_jisx0201(cs,pwc,s+1,e);
|
||||
if (ret!=1)
|
||||
return ret;
|
||||
return -2;
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -8531,7 +8531,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
return MY_CS_ILSEQ;
|
||||
|
||||
if (s+3>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL3;
|
||||
|
||||
c3=s[2];
|
||||
if (c3 < 0xA1 || c3>=0xFF)
|
||||
|
@ -8540,8 +8540,8 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
if (c2<0xF5)
|
||||
{
|
||||
pwc[0]=my_jisx0212_uni_onechar((c2-0x80)*256 + (c3-0x80));
|
||||
if (!pwc)
|
||||
return MY_CS_ILSEQ;
|
||||
if (!pwc[0])
|
||||
return -3;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8572,7 +8572,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if ((jp=my_uni_jisx0208_onechar(wc)))
|
||||
{
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
jp+=0x8080;
|
||||
s[0]=jp>>8;
|
||||
|
@ -8584,7 +8584,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if (my_wc_mb_jisx0201(c,wc,s,e) == 1)
|
||||
{
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
s[1]= s[0];
|
||||
s[0]= 0x8E;
|
||||
return 2;
|
||||
|
@ -8594,7 +8594,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if ((jp=my_uni_jisx0212_onechar(wc)))
|
||||
{
|
||||
if (s+3>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL3;
|
||||
|
||||
jp+=0x8080;
|
||||
s[0]=0x8F;
|
||||
|
@ -8608,7 +8608,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if (wc>=0xE000 && wc<0xE3AC)
|
||||
{
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
c1=((unsigned)(wc-0xE000)/94)+0xF5;
|
||||
s[0]=c1;
|
||||
|
@ -8622,7 +8622,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if (wc>=0xE3AC && wc<0xE758)
|
||||
{
|
||||
if (s+3>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL3;
|
||||
|
||||
s[0]=0x8F;
|
||||
c1=((unsigned)(wc-0xE3AC)/94)+0xF5;
|
||||
|
|
|
@ -5651,7 +5651,7 @@ my_wc_mb_gb2312(CHARSET_INFO *cs __attribute__((unused)),
|
|||
return MY_CS_ILUNI;
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
code|=0x8080;
|
||||
s[0]=code>>8;
|
||||
|
@ -5668,7 +5668,7 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
|
|||
hi=(int) s[0];
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
if (hi<0x80)
|
||||
{
|
||||
|
@ -5677,10 +5677,10 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
if (!(pwc[0]=func_gb2312_uni_onechar(((hi<<8)+s[1])&0x7F7F)))
|
||||
return MY_CS_ILSEQ;
|
||||
return -2;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
|
|
@ -9902,7 +9902,7 @@ my_wc_mb_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
|||
return MY_CS_ILUNI;
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
s[0]=code>>8;
|
||||
s[1]=code&0xFF;
|
||||
|
@ -9916,7 +9916,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
|||
int hi;
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
hi=s[0];
|
||||
|
||||
|
@ -9927,10 +9927,10 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
if (!(pwc[0]=func_gbk_uni_onechar( (hi<<8) + s[1])))
|
||||
return MY_CS_ILSEQ;
|
||||
return -2;
|
||||
|
||||
return 2;
|
||||
|
||||
|
|
|
@ -363,10 +363,10 @@ int my_mb_wc_latin1(CHARSET_INFO *cs __attribute__((unused)),
|
|||
const unsigned char *end __attribute__((unused)))
|
||||
{
|
||||
if (str >= end)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
*wc=cs_to_uni[*str];
|
||||
return (!wc[0] && str[0]) ? MY_CS_ILSEQ : 1;
|
||||
return (!wc[0] && str[0]) ? -1 : 1;
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
@ -239,10 +239,10 @@ int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc,
|
|||
const unsigned char *end __attribute__((unused)))
|
||||
{
|
||||
if (str >= end)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
*wc=cs->tab_to_uni[*str];
|
||||
return (!wc[0] && str[0]) ? MY_CS_ILSEQ : 1;
|
||||
return (!wc[0] && str[0]) ? -1 : 1;
|
||||
}
|
||||
|
||||
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc,
|
||||
|
|
|
@ -4516,7 +4516,7 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
|
||||
mb:
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
s[0]=code>>8;
|
||||
s[1]=code&0xFF;
|
||||
|
@ -4530,7 +4530,7 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
int hi=s[0];
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
if (hi < 0x80)
|
||||
{
|
||||
|
@ -4545,10 +4545,10 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
}
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
if (!(pwc[0]=func_sjis_uni_onechar((hi<<8)+s[1])))
|
||||
return MY_CS_ILSEQ;
|
||||
return -2;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
|
|
@ -827,10 +827,10 @@ int my_mb_wc_tis620(CHARSET_INFO *cs __attribute__((unused)),
|
|||
const unsigned char *end __attribute__((unused)))
|
||||
{
|
||||
if (str >= end)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
*wc=cs_to_uni[*str];
|
||||
return (!wc[0] && str[0]) ? MY_CS_ILSEQ : 1;
|
||||
return (!wc[0] && str[0]) ? -1 : 1;
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
@ -94,7 +94,7 @@ static int my_ucs2_uni(CHARSET_INFO *cs __attribute__((unused)),
|
|||
my_wc_t * pwc, const uchar *s, const uchar *e)
|
||||
{
|
||||
if (s+2 > e) /* Need 2 characters */
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
*pwc= ((unsigned char)s[0]) * 256 + ((unsigned char)s[1]);
|
||||
return 2;
|
||||
|
@ -104,7 +104,7 @@ static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
|
|||
my_wc_t wc, uchar *r, uchar *e)
|
||||
{
|
||||
if ( r+2 > e )
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
r[0]= (uchar) (wc >> 8);
|
||||
r[1]= (uchar) (wc & 0xFF);
|
||||
|
|
|
@ -242,7 +242,7 @@ my_mb_wc_jisx0201(CHARSET_INFO *cs __attribute__((unused)),
|
|||
const uchar *e __attribute__((unused)))
|
||||
{
|
||||
wc[0]=tab_jisx0201_uni[*s];
|
||||
return (!wc[0] && s[0]) ? MY_CS_ILSEQ : 1;
|
||||
return (!wc[0] && s[0]) ? -1 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -8341,7 +8341,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
int c1,c2,c3;
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
c1=s[0];
|
||||
|
||||
|
@ -8353,7 +8353,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
}
|
||||
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
c2=s[1];
|
||||
|
||||
|
@ -8368,7 +8368,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
{
|
||||
pwc[0]=my_jisx0208_uni_onechar( ((c1-0x80) << 8) + (c2-0x80));
|
||||
if (!pwc[0])
|
||||
return MY_CS_ILSEQ;
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8388,7 +8388,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
|
||||
ret = my_mb_wc_jisx0201(cs,pwc,s+1,e);
|
||||
if (ret!=1)
|
||||
return ret;
|
||||
return -2;
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -8399,7 +8399,7 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
return MY_CS_ILSEQ;
|
||||
|
||||
if (s+3>e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL3;
|
||||
|
||||
c3=s[2];
|
||||
if (c3 < 0xA1 || c3>=0xFF)
|
||||
|
@ -8408,8 +8408,8 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
|
|||
if (c2<0xF5)
|
||||
{
|
||||
pwc[0]=my_jisx0212_uni_onechar((c2-0x80)*256 + (c3-0x80));
|
||||
if (!pwc)
|
||||
return MY_CS_ILSEQ;
|
||||
if (!pwc[0])
|
||||
return -3;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8440,7 +8440,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if ((jp=my_uni_jisx0208_onechar(wc)))
|
||||
{
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
jp+=0x8080;
|
||||
s[0]=jp>>8;
|
||||
|
@ -8452,7 +8452,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if (my_wc_mb_jisx0201(c,wc,s,e) == 1)
|
||||
{
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
s[1]= s[0];
|
||||
s[0]= 0x8E;
|
||||
return 2;
|
||||
|
@ -8462,7 +8462,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if ((jp=my_uni_jisx0212_onechar(wc)))
|
||||
{
|
||||
if (s+3>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL3;
|
||||
|
||||
jp+=0x8080;
|
||||
s[0]=0x8F;
|
||||
|
@ -8476,7 +8476,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if (wc>=0xE000 && wc<0xE3AC)
|
||||
{
|
||||
if (s+2>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
c1=((unsigned)(wc-0xE000)/94)+0xF5;
|
||||
s[0]=c1;
|
||||
|
@ -8490,7 +8490,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||
if (wc>=0xE3AC && wc<0xE758)
|
||||
{
|
||||
if (s+3>e)
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALL3;
|
||||
|
||||
s[0]=0x8F;
|
||||
c1=((unsigned)(wc-0xE3AC)/94)+0xF5;
|
||||
|
|
|
@ -1947,7 +1947,7 @@ static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
|
|||
unsigned char c;
|
||||
|
||||
if (s >= e)
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
c= s[0];
|
||||
if (c < 0x80)
|
||||
|
@ -1960,7 +1960,7 @@ static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
|
|||
else if (c < 0xe0)
|
||||
{
|
||||
if (s+2 > e) /* We need 2 characters */
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL2;
|
||||
|
||||
if (!((s[1] ^ 0x80) < 0x40))
|
||||
return MY_CS_ILSEQ;
|
||||
|
@ -1971,7 +1971,7 @@ static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
|
|||
else if (c < 0xf0)
|
||||
{
|
||||
if (s+3 > e) /* We need 3 characters */
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL3;
|
||||
|
||||
if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (c >= 0xe1 || s[1] >= 0xa0)))
|
||||
return MY_CS_ILSEQ;
|
||||
|
@ -1986,7 +1986,7 @@ static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
|
|||
else if (c < 0xf8 && sizeof(my_wc_t)*8 >= 32)
|
||||
{
|
||||
if (s+4 > e) /* We need 4 characters */
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL4;
|
||||
|
||||
if (!((s[1] ^ 0x80) < 0x40 &&
|
||||
(s[2] ^ 0x80) < 0x40 &&
|
||||
|
@ -2004,7 +2004,7 @@ static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
|
|||
else if (c < 0xfc && sizeof(my_wc_t)*8 >= 32)
|
||||
{
|
||||
if (s+5 >e) /* We need 5 characters */
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL5;
|
||||
|
||||
if (!((s[1] ^ 0x80) < 0x40 &&
|
||||
(s[2] ^ 0x80) < 0x40 &&
|
||||
|
@ -2023,7 +2023,7 @@ static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
|
|||
else if (c < 0xfe && sizeof(my_wc_t)*8 >= 32)
|
||||
{
|
||||
if ( s+6 >e ) /* We need 6 characters */
|
||||
return MY_CS_TOOFEW(0);
|
||||
return MY_CS_TOOSMALL6;
|
||||
|
||||
if (!((s[1] ^ 0x80) < 0x40 &&
|
||||
(s[2] ^ 0x80) < 0x40 &&
|
||||
|
@ -2074,7 +2074,7 @@ static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)) ,
|
|||
Because of it (r+count > e), not (r+count-1 >e )
|
||||
*/
|
||||
if ( r+count > e )
|
||||
return MY_CS_TOOSMALL;
|
||||
return MY_CS_TOOSMALLN(count);
|
||||
|
||||
switch (count) {
|
||||
/* Fall through all cases!!! */
|
||||
|
|
Loading…
Reference in a new issue