Portability fixes (for windows)
Some changes to the prepared statement protocol to make it easier to use and faster. Makefile.am: Fix to make dist to work with cmd-line-utils client/mysql.cc: Portability fixes client/mysqlbinlog.cc: Portabiliy fixes and remove usafe of FILE configure.in: Fix to make dist to work with cmd-line-utils heap/_check.c: Portability fixes include/config-win.h: Portability fixes include/m_ctype.h: Indentation cleanup include/my_list.h: Portability fixes include/mysql.h: Cleanup of BIND structure include/violite.h: Portability fixes innobase/dict/dict0dict.c: Portability fixes innobase/dict/dict0load.c: Portability fixes innobase/include/os0proc.h: Portability fixes (Heikki, please check) innobase/os/os0proc.c: Portability fixes (Heikki, please check) innobase/ut/ut0ut.c: Portability fixes isam/pack_isam.c: Portability fixes libmysql/libmysql.c: Portability fixes Remove obscure usage of the length parameter for prepared statements. libmysql/libmysql.def: Remove not existing functions libmysqld/lib_sql.cc: Remove compiler warning mysql-test/r/explain.result: Fix after merge mysql-test/r/join.result: Fix after merge mysys/my_once.c: Portability fix mysys/tree.c: Portability fixes sql/field.cc: Portability fixes sql/filesort.cc: move assert.h to mysql_priv.h sql/ha_berkeley.cc: move assert.h to mysql_priv.h sql/ha_innodb.cc: move assert.h to mysql_priv.h sql/item.cc: move assert.h to mysql_priv.h Fixed syntax error sql/item_cmpfunc.cc: move assert.h to mysql_priv.h sql/item_func.cc: move assert.h to mysql_priv.h sql/item_row.cc: move assert.h to mysql_priv.h sql/item_strfunc.cc: Portability fix sql/item_subselect.cc: Portability fix sql/item_sum.cc: move assert.h to mysql_priv.h sql/lex.h: Portability fix sql/lock.cc: move assert.h to mysql_priv.h sql/log.cc: move assert.h to mysql_priv.h sql/log_event.cc: Portability fix sql/mf_iocache.cc: move assert.h to mysql_priv.h sql/mysql_priv.h: move assert.h to mysql_priv.h sql/mysqld.cc: move assert.h to mysql_priv.h sql/opt_range.cc: move assert.h to mysql_priv.h sql/password.c: Portability fix sql/protocol.cc: move assert.h to mysql_priv.h sql/set_var.cc: Portability fix sql/slave.cc: move assert.h to mysql_priv.h sql/spatial.cc: Portability fix sql/sql_acl.cc: move assert.h to mysql_priv.h sql/sql_base.cc: move assert.h to mysql_priv.h sql/sql_cache.cc: move assert.h to mysql_priv.h sql/sql_class.cc: move assert.h to mysql_priv.h sql/sql_handler.cc: move assert.h to mysql_priv.h sql/sql_help.cc: Removed compiler warning sql/sql_lex.cc: Portability fix sql/sql_lex.h: Portability fix sql/sql_parse.cc: move assert.h to mysql_priv.h sql/sql_prepare.cc: move assert.h to mysql_priv.h sql/sql_repl.cc: move assert.h to mysql_priv.h sql/sql_select.cc: move assert.h to mysql_priv.h sql/sql_string.cc: Portability fix sql/sql_string.h: Portability fix sql/sql_table.cc: move assert.h to mysql_priv.h sql/sql_yacc.yy: Portability fix Remove not accessed code strings/ctype-bin.c: Portability fix strings/ctype-mb.c: Portability fix strings/ctype.c: Portability fix tests/client_test.c: A
This commit is contained in:
parent
fd86106365
commit
10e22c346a
@ -3,9 +3,9 @@
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium_cflags $fast_cflags"
|
||||
extra_flags="$pentium_cflags $fast_cflags -g"
|
||||
extra_configs="$pentium_configs"
|
||||
strip=yes
|
||||
#strip=yes
|
||||
|
||||
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
|
||||
--with-embedded-server --enable-thread-safe-client \
|
||||
|
@ -21,7 +21,8 @@ AUTOMAKE_OPTIONS = foreign
|
||||
# These are built from source in the Docs directory
|
||||
EXTRA_DIST = INSTALL-SOURCE README \
|
||||
COPYING COPYING.LIB
|
||||
SUBDIRS = . include @docs_dirs@ @readline_dir@ \
|
||||
SUBDIRS = . include @docs_dirs@ \
|
||||
@readline_topdir@ @readline_dir@ \
|
||||
@thread_dirs@ pstack @sql_client_dirs@ \
|
||||
@sql_server_dirs@ scripts man tests \
|
||||
BUILD os2 libmysql_r @libmysqld_dirs@ \
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000-2002 MySQL AB
|
||||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -80,8 +80,6 @@ extern "C" {
|
||||
#if defined( __WIN__) || defined(OS2)
|
||||
#include <conio.h>
|
||||
#else
|
||||
// readline 4.2 has own __P
|
||||
#undef __P
|
||||
#include <readline/readline.h>
|
||||
#define HAVE_READLINE
|
||||
#endif
|
||||
@ -1443,7 +1441,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
||||
|
||||
if (result)
|
||||
{
|
||||
int num_rows= mysql_num_rows(result);
|
||||
ulonglong num_rows= mysql_num_rows(result);
|
||||
if (num_rows == 1)
|
||||
{
|
||||
if (!(cur= mysql_fetch_row(result)))
|
||||
|
@ -67,7 +67,8 @@ static void dump_remote_table(NET* net, const char* db, const char* table);
|
||||
static void die(const char* fmt, ...);
|
||||
static MYSQL* safe_connect();
|
||||
|
||||
class Load_log_processor {
|
||||
class Load_log_processor
|
||||
{
|
||||
char target_dir_name[MY_NFILE];
|
||||
int target_dir_name_len;
|
||||
DYNAMIC_ARRAY file_names;
|
||||
@ -103,12 +104,10 @@ class Load_log_processor {
|
||||
void append_to_file(const char* fname, int flags,
|
||||
gptr data, uint size)
|
||||
{
|
||||
FILE *file;
|
||||
if(!(file= my_fopen(fname,flags,MYF(MY_WME))))
|
||||
exit(1);
|
||||
if (my_fwrite(file,data,size,MYF(MY_WME|MY_NABP)))
|
||||
exit(1);
|
||||
if (my_fclose(file,MYF(MY_WME)))
|
||||
File file;
|
||||
if ((file= my_open(fname,flags,MYF(MY_WME)) < 0) ||
|
||||
my_write(file,(byte*) data,size,MYF(MY_WME|MY_NABP)) ||
|
||||
my_close(file,MYF(MY_WME)))
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -176,7 +175,7 @@ public:
|
||||
void process(Create_file_log_event *ce)
|
||||
{
|
||||
const char *fname= create_file(ce);
|
||||
append_to_file (fname,O_CREAT|O_BINARY,ce->block,ce->block_len);
|
||||
append_to_file(fname,O_CREAT|O_BINARY,ce->block,ce->block_len);
|
||||
}
|
||||
void process(Append_block_log_event *ae)
|
||||
{
|
||||
|
6
cmd-line-utils/Makefile.am
Normal file
6
cmd-line-utils/Makefile.am
Normal file
@ -0,0 +1,6 @@
|
||||
## Process this file with automake to create Makefile.in
|
||||
|
||||
SUBDIRS= @readline_basedir@
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
25
configure.in
25
configure.in
@ -2039,14 +2039,18 @@ mkdir include/readline
|
||||
|
||||
if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
|
||||
then
|
||||
readline_dir="cmd-line-utils/libedit"
|
||||
readline_topdir="cmd-line-utils"
|
||||
readline_basedir="libedit"
|
||||
readline_dir="$readline_topdir/$readline_basedir"
|
||||
readline_link="\$(top_builddir)/cmd-line-utils/libedit/liblibedit.a"
|
||||
readline_h_ln_cmd="\$(LN) \$(top_builddir)/cmd-line-utils/libedit/readline/*.h readline/"
|
||||
compile_libedit=yes
|
||||
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE)
|
||||
elif test "$with_readline" = "yes"
|
||||
then
|
||||
readline_dir="cmd-line-utils/readline"
|
||||
readline_topdir="cmd-line-utils"
|
||||
readline_basedir="readline"
|
||||
readline_dir="$readline_topdir/$readline_basedir"
|
||||
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
|
||||
readline_h_ln_cmd="\$(LN) \$(top_builddir)/cmd-line-utils/readline/*.h readline/"
|
||||
compile_readline=yes
|
||||
@ -2056,16 +2060,19 @@ else
|
||||
MYSQL_CHECK_NEW_RL_INTERFACE
|
||||
if ["$mysql_cv_new_rl_interface"="yes"] || [test "$mysql_cv_libedit_interface"="no"]
|
||||
then
|
||||
readline_dir=""
|
||||
readline_link="-lreadline"
|
||||
else
|
||||
readline_dir=""
|
||||
readline_link="-ledit"
|
||||
fi
|
||||
readline_topdir=""
|
||||
readline_basedir=""
|
||||
readline_dir=""
|
||||
readline_h_ln_cmd=""
|
||||
fi
|
||||
|
||||
AC_SUBST(readline_dir)
|
||||
AC_SUBST(readline_topdir)
|
||||
AC_SUBST(readline_basedir)
|
||||
AC_SUBST(readline_link)
|
||||
AC_SUBST(readline_h_ln_cmd)
|
||||
|
||||
@ -2077,10 +2084,10 @@ dnl you must also create strings/ctype-$charset_name.c
|
||||
|
||||
AC_DIVERT_PUSH(0)
|
||||
CHARSETS_AVAILABLE="armscii8 big5 cp1251 cp1257
|
||||
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
|
||||
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
|
||||
latin1 latin1_de latin2 latin5 sjis swe7 tis620 ucs2 ujis
|
||||
usa7 utf8 win1250 win1250ch win1251ukr"
|
||||
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
|
||||
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
|
||||
latin1 latin1_de latin2 latin5 sjis swe7 tis620 ucs2 ujis
|
||||
usa7 utf8 win1250 win1250ch win1251ukr"
|
||||
CHARSETS_DEPRECATED="win1251"
|
||||
CHARSETS_COMPLEX="big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ucs2 ujis utf8 win1250ch"
|
||||
DEFAULT_CHARSET=latin1
|
||||
@ -2454,11 +2461,13 @@ AC_SUBST(GXX)
|
||||
|
||||
if test "$compile_readline" = "yes"
|
||||
then
|
||||
AC_OUTPUT(cmd-line-utils/Makefile)
|
||||
AC_OUTPUT(cmd-line-utils/readline/Makefile)
|
||||
fi
|
||||
|
||||
if test "$compile_libedit" = "yes"
|
||||
then
|
||||
AC_OUTPUT(cmd-line-utils/Makefile)
|
||||
AC_OUTPUT(cmd-line-utils/libedit/Makefile)
|
||||
fi
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
|
||||
ulong blength, my_bool print_status);
|
||||
static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
|
||||
my_bool print_status);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -262,6 +262,7 @@ inline double ulonglong2double(ulonglong value)
|
||||
#define HAVE_ISAM /* We want to have support for ISAM in 4.0 */
|
||||
#define HAVE_QUERY_CACHE
|
||||
#define SPRINTF_RETURNS_INT
|
||||
#define HAVE_VIO
|
||||
|
||||
#ifdef NOT_USED
|
||||
#define HAVE_SNPRINTF /* Gave link error */
|
||||
|
@ -26,7 +26,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define MY_CS_NAME_SIZE 32
|
||||
#define MY_CS_CTYPE_TABLE_SIZE 257
|
||||
#define MY_CS_TO_LOWER_TABLE_SIZE 256
|
||||
@ -38,7 +37,8 @@ extern "C" {
|
||||
|
||||
#define my_wc_t ulong
|
||||
|
||||
typedef struct unicase_info_st {
|
||||
typedef struct unicase_info_st
|
||||
{
|
||||
uint16 toupper;
|
||||
uint16 tolower;
|
||||
uint16 sort;
|
||||
@ -66,7 +66,8 @@ typedef struct unicase_info_st {
|
||||
#define MY_CHARSET_CURRENT (default_charset_info->number)
|
||||
|
||||
|
||||
typedef struct my_uni_idx_st {
|
||||
typedef struct my_uni_idx_st
|
||||
{
|
||||
uint16 from;
|
||||
uint16 to;
|
||||
uchar *tab;
|
||||
@ -136,18 +137,27 @@ typedef struct charset_info_st
|
||||
char max_sort_char; /* For LIKE optimization */
|
||||
|
||||
/* Charset dependant snprintf() */
|
||||
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt, ...);
|
||||
int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix, long int val);
|
||||
int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n, int radix, longlong val);
|
||||
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
|
||||
...);
|
||||
int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix,
|
||||
long int val);
|
||||
int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
|
||||
int radix, longlong val);
|
||||
|
||||
/* String-to-number convertion routines */
|
||||
long (*strntol)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
|
||||
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
|
||||
longlong (*strntoll)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
|
||||
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
|
||||
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e, int *err);
|
||||
long (*strntol)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
longlong (*strntoll)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
|
||||
int *err);
|
||||
|
||||
ulong (*scan)(struct charset_info_st *, const char *b, const char *e, int sq);
|
||||
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
|
||||
int sq);
|
||||
|
||||
} CHARSET_INFO;
|
||||
|
||||
@ -162,8 +172,10 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len,
|
||||
int (*add)(CHARSET_INFO *cs));
|
||||
|
||||
/* declarations for simple charsets */
|
||||
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *, uint);
|
||||
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint, const uchar *, uint);
|
||||
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
|
||||
uint);
|
||||
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
|
||||
const uchar *, uint);
|
||||
|
||||
extern uint my_hash_caseup_simple(CHARSET_INFO *cs,
|
||||
const byte *key, uint len);
|
||||
@ -181,36 +193,45 @@ extern void my_casedn_8bit(CHARSET_INFO *, char *, uint);
|
||||
extern void my_tosort_8bit(CHARSET_INFO *, char *, uint);
|
||||
|
||||
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
|
||||
extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *, uint);
|
||||
extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *,
|
||||
uint);
|
||||
|
||||
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
|
||||
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
|
||||
|
||||
ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
|
||||
|
||||
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n, const char *fmt, ...);
|
||||
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
|
||||
const char *fmt, ...);
|
||||
|
||||
long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
|
||||
ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
|
||||
longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
|
||||
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
|
||||
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e, int *err);
|
||||
long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
|
||||
int *err);
|
||||
|
||||
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, long int val);
|
||||
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, longlong val);
|
||||
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
||||
long int val);
|
||||
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
||||
longlong val);
|
||||
|
||||
my_bool my_like_range_simple(CHARSET_INFO *cs,
|
||||
const char *ptr, uint ptr_length,
|
||||
int escape, int w_one, int w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
const char *ptr, uint ptr_length,
|
||||
int escape, int w_one, int w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
|
||||
|
||||
int my_wildcmp_8bit(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
|
||||
|
||||
#ifdef USE_MB
|
||||
@ -220,15 +241,14 @@ extern void my_casedn_str_mb(CHARSET_INFO *, char *);
|
||||
extern void my_caseup_mb(CHARSET_INFO *, char *, uint);
|
||||
extern void my_casedn_mb(CHARSET_INFO *, char *, uint);
|
||||
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
|
||||
extern int my_strncasecmp_mb(CHARSET_INFO * cs,const char *, const char *t, uint);
|
||||
extern int my_strncasecmp_mb(CHARSET_INFO * cs,const char *, const char *t,
|
||||
uint);
|
||||
int my_wildcmp_mb(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define _U 01 /* Upper case */
|
||||
#define _L 02 /* Lower case */
|
||||
#define _NMR 04 /* Numeral (digit) */
|
||||
|
@ -32,8 +32,8 @@ extern LIST *list_add(LIST *root,LIST *element);
|
||||
extern LIST *list_delete(LIST *root,LIST *element);
|
||||
extern LIST *list_cons(void *data,LIST *root);
|
||||
extern LIST *list_reverse(LIST *root);
|
||||
extern void list_free(LIST *root,uint free_data);
|
||||
extern uint list_length(LIST *list);
|
||||
extern void list_free(LIST *root,unsigned int free_data);
|
||||
extern unsigned int list_length(LIST *list);
|
||||
extern int list_walk(LIST *list,list_walk_action action,gptr argument);
|
||||
|
||||
#define rest(a) ((a)->next)
|
||||
|
@ -439,17 +439,17 @@ enum PREP_STMT_STATE { MY_ST_UNKNOWN, MY_ST_PREPARE, MY_ST_EXECUTE };
|
||||
/* bind structure */
|
||||
typedef struct st_mysql_bind
|
||||
{
|
||||
long *length; /* output length pointer */
|
||||
gptr buffer; /* buffer */
|
||||
unsigned long *length; /* output length pointer */
|
||||
my_bool *is_null; /* Pointer to null indicators */
|
||||
char *buffer; /* buffer to get/put data */
|
||||
enum enum_field_types buffer_type; /* buffer type */
|
||||
my_bool is_null; /* NULL indicator */
|
||||
my_bool is_long_data; /* long data indicator */
|
||||
/* Must be set for string/blob data */
|
||||
unsigned long buffer_length; /* buffer length */
|
||||
|
||||
/* The following are for internal use. Set by mysql_bind_param */
|
||||
unsigned long buffer_length; /* buffer length */
|
||||
long bind_length; /* Default length of data */
|
||||
my_bool long_ended; /* All data supplied for long */
|
||||
unsigned long bind_length; /* Default length of data */
|
||||
unsigned int param_number; /* For null count and error messages */
|
||||
my_bool long_data_used; /* If used with mysql_send_long_data */
|
||||
void (*store_param_func)(NET *net, struct st_mysql_bind *param);
|
||||
void (*fetch_result)(struct st_mysql_bind *, unsigned char **row);
|
||||
} MYSQL_BIND;
|
||||
@ -465,20 +465,21 @@ typedef struct st_mysql_stmt
|
||||
MYSQL_FIELD *fields; /* prepare meta info */
|
||||
LIST list; /* list to keep track of all stmts */
|
||||
char *query; /* query buffer */
|
||||
char *buffer; /* buffer to hold results */
|
||||
MEM_ROOT mem_root; /* root allocations */
|
||||
MYSQL_RES tmp_result; /* Used by mysql_prepare_result */
|
||||
unsigned long param_count; /* parameters count */
|
||||
unsigned long field_count; /* fields count */
|
||||
unsigned long long_length; /* long buffer alloced length */
|
||||
unsigned long buffer_length; /* long buffer alloced length */
|
||||
unsigned long stmt_id; /* Id for prepared statement */
|
||||
unsigned int last_errno; /* error code */
|
||||
enum PREP_STMT_STATE state; /* statement state */
|
||||
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
|
||||
my_bool long_alloced; /* flag to indicate long alloced */
|
||||
my_bool send_types_to_server; /* to indicate types supply to server */
|
||||
my_bool param_buffers; /* to indicate the param bound buffers */
|
||||
my_bool res_buffers; /* to indicate the output bound buffers */
|
||||
my_bool result_buffered; /* to indicate the results buffered */
|
||||
my_bool send_types_to_server; /* Types sent to server */
|
||||
my_bool param_buffers; /* param bound buffers */
|
||||
my_bool res_buffers; /* output bound buffers */
|
||||
my_bool result_buffered; /* Results buffered */
|
||||
} MYSQL_STMT;
|
||||
|
||||
|
||||
@ -498,10 +499,7 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt);
|
||||
my_bool STDCALL mysql_send_long_data(MYSQL_STMT *stmt,
|
||||
unsigned int param_number,
|
||||
const char *data,
|
||||
unsigned long length,
|
||||
my_bool last_data);
|
||||
int STDCALL mysql_multi_query(MYSQL *mysql,const char *query,
|
||||
unsigned long len);
|
||||
unsigned long length);
|
||||
MYSQL_RES *STDCALL mysql_prepare_result(MYSQL_STMT *stmt);
|
||||
my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
|
||||
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
|
||||
@ -515,8 +513,6 @@ my_bool STDCALL mysql_next_result(MYSQL *mysql);
|
||||
#define MYSQL_STATUS_ERROR 1
|
||||
#define MYSQL_NO_DATA 100
|
||||
#define MYSQL_NEED_DATA 99
|
||||
#define MYSQL_NULL_DATA (-1)
|
||||
#define MYSQL_LONG_DATA (-2)
|
||||
|
||||
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
|
||||
|
||||
|
@ -216,6 +216,7 @@ enum SSL_type
|
||||
SSL_TYPE_SPECIFIED
|
||||
};
|
||||
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
/* This structure is for every connection on both sides */
|
||||
struct st_vio
|
||||
@ -233,7 +234,7 @@ struct st_vio
|
||||
void (*viodelete)(Vio*);
|
||||
int (*vioerrno)(Vio*);
|
||||
int (*read)(Vio*, gptr, int);
|
||||
int (*write)(Vio*, gptr, int);
|
||||
int (*write)(Vio*, const gptr, int);
|
||||
int (*vioblocking)(Vio*, my_bool, my_bool *);
|
||||
my_bool (*is_blocking)(Vio*);
|
||||
int (*viokeepalive)(Vio*, my_bool);
|
||||
|
@ -2181,6 +2181,7 @@ dict_skip_word(
|
||||
/*************************************************************************
|
||||
Returns the number of opening brackets '(' subtracted by the number
|
||||
of closing brackets ')' between string and ptr. */
|
||||
#ifdef NOT_USED
|
||||
static
|
||||
int
|
||||
dict_bracket_count(
|
||||
@ -2204,7 +2205,7 @@ dict_bracket_count(
|
||||
|
||||
return(count);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*************************************************************************
|
||||
Scans a table create SQL string and adds to the data dictionary the foreign
|
||||
key constraints declared in the string. This function should be called after
|
||||
|
@ -456,7 +456,7 @@ dict_load_indexes(
|
||||
ut_ad(len == 8);
|
||||
id = mach_read_from_8(field);
|
||||
|
||||
ut_a(0 == ut_strcmp("NAME",
|
||||
ut_a(0 == ut_strcmp((void*) "NAME",
|
||||
dict_field_get_col(
|
||||
dict_index_get_nth_field(
|
||||
dict_table_get_first_index(sys_indexes), 4))->name));
|
||||
@ -515,7 +515,7 @@ dict_load_indexes(
|
||||
&& ((type & DICT_CLUSTERED)
|
||||
|| ((table == dict_sys->sys_tables)
|
||||
&& (name_len == ut_strlen("ID_IND"))
|
||||
&& (0 == ut_memcmp(name_buf, "ID_IND",
|
||||
&& (0 == ut_memcmp(name_buf, (void*) "ID_IND",
|
||||
name_len))))) {
|
||||
|
||||
/* The index was created in memory already in
|
||||
|
@ -16,7 +16,7 @@ typedef void* os_process_t;
|
||||
typedef unsigned long int os_process_id_t;
|
||||
|
||||
/* The cell type in os_awe_allocate_mem page info */
|
||||
#ifdef __NT__
|
||||
#if defined(__NT__) && defined(ULONG_PTR)
|
||||
typedef ULONG_PTR os_awe_t;
|
||||
#else
|
||||
typedef ulint os_awe_t;
|
||||
|
@ -189,12 +189,12 @@ os_awe_allocate_physical_mem(
|
||||
|
||||
#elif defined(__NT__)
|
||||
BOOL bResult;
|
||||
ULONG_PTR NumberOfPages; /* Question: why does Windows
|
||||
os_awe_t NumberOfPages; /* Question: why does Windows
|
||||
use the name ULONG_PTR for
|
||||
a scalar integer type? Maybe
|
||||
because we may also refer to
|
||||
&NumberOfPages? */
|
||||
ULONG_PTR NumberOfPagesInitial;
|
||||
os_awe_t NumberOfPagesInitial;
|
||||
SYSTEM_INFO sSysInfo;
|
||||
int PFNArraySize;
|
||||
|
||||
@ -224,9 +224,9 @@ os_awe_allocate_physical_mem(
|
||||
|
||||
/* Calculate the size of page_info for allocated physical pages */
|
||||
|
||||
PFNArraySize = NumberOfPages * sizeof(ULONG_PTR);
|
||||
PFNArraySize = NumberOfPages * sizeof(os_awe_t);
|
||||
|
||||
*page_info = (ULONG_PTR*)HeapAlloc(GetProcessHeap(), 0, PFNArraySize);
|
||||
*page_info = (os_awe_t*)HeapAlloc(GetProcessHeap(), 0, PFNArraySize);
|
||||
|
||||
if (*page_info == NULL) {
|
||||
fprintf(stderr,
|
||||
@ -426,9 +426,9 @@ os_awe_map_physical_mem_to_window(
|
||||
|
||||
#elif defined(__NT__)
|
||||
BOOL bResult;
|
||||
ULONG_PTR n_pages;
|
||||
os_awe_t n_pages;
|
||||
|
||||
n_pages = (ULONG_PTR)n_mem_pages;
|
||||
n_pages = (os_awe_t)n_mem_pages;
|
||||
|
||||
if (!(ptr >= os_awe_window)) {
|
||||
fprintf(stderr,
|
||||
|
@ -13,6 +13,7 @@ Created 5/11/1994 Heikki Tuuri
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ut0sort.h"
|
||||
|
||||
|
@ -46,22 +46,6 @@
|
||||
#define OLD_EXT ".OLD"
|
||||
#define WRITE_COUNT MY_HOW_OFTEN_TO_WRITE
|
||||
|
||||
#ifdef __WIN__
|
||||
static double ulonglong2double(ulonglong value)
|
||||
{
|
||||
longlong nr=(longlong) value;
|
||||
if (nr >= 0)
|
||||
return (double) nr;
|
||||
return (18446744073709551616.0 + (double) nr);
|
||||
}
|
||||
|
||||
#if SIZEOF_OFF_T > 4
|
||||
#define my_off_t2double(A) ulonglong2double(A)
|
||||
#else
|
||||
#define my_off_t2double(A) ((double) (A))
|
||||
#endif /* SIZEOF_OFF_T > 4 */
|
||||
#endif
|
||||
|
||||
struct st_file_buffer {
|
||||
File file;
|
||||
char *buffer,*pos,*end;
|
||||
|
@ -452,14 +452,16 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
|
||||
unique_part is uniquel value for each object (events and file-mapping)
|
||||
number_of_connection is number of connection between server and client
|
||||
*/
|
||||
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,"_",NullS);
|
||||
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,
|
||||
"_",NullS);
|
||||
strmov(suffix_pos, "DATA");
|
||||
if ((handle_file_map = OpenFileMapping(FILE_MAP_WRITE,FALSE,tmp)) == NULL)
|
||||
{
|
||||
error_allow = CR_SHARED_MEMORY_FILE_MAP_ERROR;
|
||||
goto err2;
|
||||
}
|
||||
if ((handle_map = MapViewOfFile(handle_file_map,FILE_MAP_WRITE,0,0,smem_buffer_length)) == NULL)
|
||||
if ((handle_map = MapViewOfFile(handle_file_map,FILE_MAP_WRITE,0,0,
|
||||
smem_buffer_length)) == NULL)
|
||||
{
|
||||
error_allow = CR_SHARED_MEMORY_MAP_ERROR;
|
||||
goto err2;
|
||||
@ -2330,8 +2332,8 @@ Try also with PIPE or TCP/IP
|
||||
/* Create password to decode scramble */
|
||||
create_key_from_old_password(passwd,password_hash);
|
||||
/* Decypt and store scramble 4 = hash for stage2 */
|
||||
password_crypt(net->read_pos+4,mysql->scramble_buff,password_hash,
|
||||
SCRAMBLE41_LENGTH);
|
||||
password_crypt((const char*) net->read_pos+4,mysql->scramble_buff,
|
||||
password_hash, SCRAMBLE41_LENGTH);
|
||||
mysql->scramble_buff[SCRAMBLE41_LENGTH]=0;
|
||||
/* Finally scramble decoded scramble with password */
|
||||
scramble(buff, mysql->scramble_buff, passwd,0);
|
||||
@ -4088,37 +4090,33 @@ static void store_param_null(NET *net, MYSQL_BIND *param)
|
||||
client application
|
||||
*/
|
||||
|
||||
|
||||
static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
|
||||
{
|
||||
MYSQL *mysql= stmt->mysql;
|
||||
NET *net = &mysql->net;
|
||||
DBUG_ENTER("store_param");
|
||||
DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %d", param->buffer_type,
|
||||
param->buffer ? param->buffer : "0", *param->length));
|
||||
|
||||
if (param->buffer_type == MYSQL_TYPE_NULL ||
|
||||
*param->length == MYSQL_NULL_DATA)
|
||||
DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %lu is_null: %d",
|
||||
param->buffer_type,
|
||||
param->buffer ? param->buffer : "0", *param->length,
|
||||
*param->is_null));
|
||||
|
||||
if (*param->is_null)
|
||||
store_param_null(net, param);
|
||||
else
|
||||
{
|
||||
unsigned int length;
|
||||
|
||||
/*
|
||||
Allocate for worst case (long string), ignore the length
|
||||
buffer for numeric/double types by assigning the default
|
||||
length using get_binary_length
|
||||
*/
|
||||
|
||||
if (!(length= get_binary_length(param->buffer_type)))
|
||||
length= *param->length;
|
||||
|
||||
if ((my_realloc_str(net, 9 + length)))
|
||||
/*
|
||||
Param->length should ALWAYS point to the correct length for the type
|
||||
Either to the length pointer given by the user or param->bind_length
|
||||
*/
|
||||
if ((my_realloc_str(net, 9 + *param->length)))
|
||||
DBUG_RETURN(1);
|
||||
(*param->store_param_func)(net, param);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Send the prepare query to server for execution
|
||||
*/
|
||||
@ -4200,14 +4198,11 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt)
|
||||
|
||||
for (param= stmt->params; param < param_end; param++)
|
||||
{
|
||||
/* Check for long data which has not been propery given/terminated */
|
||||
if (*param->length == MYSQL_LONG_DATA)
|
||||
{
|
||||
if (!param->long_ended)
|
||||
DBUG_RETURN(MYSQL_NEED_DATA);
|
||||
}
|
||||
/* check if mysql_long_data() was used */
|
||||
if (param->long_data_used)
|
||||
param->long_data_used= 0; /* Clear for next execute call */
|
||||
else if (store_param(stmt, param))
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
length= (ulong) (net->write_pos - net->buff);
|
||||
/* TODO: Look into avoding the following memdup */
|
||||
@ -4245,6 +4240,11 @@ my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt)
|
||||
return stmt->mysql->last_used_con->affected_rows;
|
||||
}
|
||||
|
||||
|
||||
static my_bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */
|
||||
static my_bool int_is_null_false= 0;
|
||||
static my_bool int_is_null_dummy;
|
||||
|
||||
/*
|
||||
Setup the parameter data buffers from application
|
||||
*/
|
||||
@ -4277,19 +4277,6 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
|
||||
param++)
|
||||
{
|
||||
param->param_number= count++;
|
||||
if (param->length && *param->length == MYSQL_LONG_DATA &&
|
||||
(param->buffer_type < MYSQL_TYPE_TINY_BLOB ||
|
||||
param->buffer_type > MYSQL_TYPE_STRING))
|
||||
{
|
||||
/*
|
||||
Long data handling should be used only for string/binary
|
||||
types only
|
||||
*/
|
||||
sprintf(stmt->last_error, ER(stmt->last_errno= CR_INVALID_BUFFER_USE),
|
||||
param->param_number);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
/*
|
||||
If param->length is not given, change it to point to bind_length.
|
||||
This way we can always use *param->length to get the length of data
|
||||
@ -4297,33 +4284,44 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
|
||||
if (!param->length)
|
||||
param->length= ¶m->bind_length;
|
||||
|
||||
/* If param->is_null is not set, then the value can never be NULL */
|
||||
if (!param->is_null)
|
||||
param->is_null= &int_is_null_false;
|
||||
|
||||
/* Setup data copy functions for the different supported types */
|
||||
switch (param->buffer_type) {
|
||||
case MYSQL_TYPE_NULL:
|
||||
param->bind_length= MYSQL_NULL_DATA;
|
||||
param->is_null= &int_is_null_true;
|
||||
break;
|
||||
case MYSQL_TYPE_TINY:
|
||||
param->bind_length= 1;
|
||||
/* Force param->length as this is fixed for this type */
|
||||
param->length= ¶m->bind_length;
|
||||
param->bind_length= param->buffer_length= 1;
|
||||
param->store_param_func= store_param_tinyint;
|
||||
break;
|
||||
case MYSQL_TYPE_SHORT:
|
||||
param->bind_length= 2;
|
||||
param->length= ¶m->bind_length;
|
||||
param->bind_length= param->buffer_length= 2;
|
||||
param->store_param_func= store_param_short;
|
||||
break;
|
||||
case MYSQL_TYPE_LONG:
|
||||
param->bind_length= 4;
|
||||
param->length= ¶m->bind_length;
|
||||
param->bind_length= param->buffer_length= 4;
|
||||
param->store_param_func= store_param_int32;
|
||||
break;
|
||||
case MYSQL_TYPE_LONGLONG:
|
||||
param->bind_length= 8;
|
||||
param->length= ¶m->bind_length;
|
||||
param->bind_length= param->buffer_length= 8;
|
||||
param->store_param_func= store_param_int64;
|
||||
break;
|
||||
case MYSQL_TYPE_FLOAT:
|
||||
param->bind_length= 4;
|
||||
param->length= ¶m->bind_length;
|
||||
param->bind_length= param->buffer_length= 4;
|
||||
param->store_param_func= store_param_float;
|
||||
break;
|
||||
case MYSQL_TYPE_DOUBLE:
|
||||
param->bind_length= 8;
|
||||
param->length= ¶m->bind_length;
|
||||
param->bind_length= param->buffer_length= 8;
|
||||
param->store_param_func= store_param_double;
|
||||
break;
|
||||
case MYSQL_TYPE_TINY_BLOB:
|
||||
@ -4336,7 +4334,8 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
|
||||
param->store_param_func= store_param_str;
|
||||
break;
|
||||
default:
|
||||
sprintf(stmt->last_error, ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
|
||||
sprintf(stmt->last_error,
|
||||
ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
|
||||
param->buffer_type, param->param_number);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
@ -4361,18 +4360,16 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
|
||||
param_number Parameter number (0 - N-1)
|
||||
data Data to send to server
|
||||
length Length of data to send (may be 0)
|
||||
last_data If != 0 then this is the last data to the
|
||||
server.
|
||||
|
||||
RETURN VALUES
|
||||
0 ok
|
||||
1 error
|
||||
0 ok
|
||||
1 error
|
||||
*/
|
||||
|
||||
|
||||
my_bool STDCALL
|
||||
mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
||||
const char *data, ulong length,
|
||||
my_bool last_data)
|
||||
const char *data, ulong length)
|
||||
{
|
||||
MYSQL_BIND *param;
|
||||
DBUG_ENTER("mysql_send_long_data");
|
||||
@ -4386,6 +4383,19 @@ mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
param= stmt->params+param_number;
|
||||
if (param->buffer_type < MYSQL_TYPE_TINY_BLOB ||
|
||||
param->buffer_type > MYSQL_TYPE_STRING)
|
||||
{
|
||||
/*
|
||||
Long data handling should be used only for string/binary
|
||||
types only
|
||||
*/
|
||||
sprintf(stmt->last_error, ER(stmt->last_errno= CR_INVALID_BUFFER_USE),
|
||||
param->param_number);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
/* Mark for execute that the result is already sent */
|
||||
param->long_data_used= 1;
|
||||
if (length)
|
||||
{
|
||||
MYSQL *mysql= stmt->mysql;
|
||||
@ -4407,7 +4417,6 @@ mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
param->long_ended= last_data;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@ -4582,6 +4591,7 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Fetch data to buffers */
|
||||
static my_bool fetch_results(MYSQL_STMT *stmt, MYSQL_BIND *param,
|
||||
uint field_type, uchar **row)
|
||||
@ -4645,7 +4655,7 @@ static my_bool fetch_results(MYSQL_STMT *stmt, MYSQL_BIND *param,
|
||||
break;
|
||||
}
|
||||
if (param->buffer_type < MYSQL_TYPE_VAR_STRING ||
|
||||
param->buffer_type > MYSQL_TYPE_STRING)
|
||||
param->buffer_type > MYSQL_TYPE_STRING)
|
||||
{
|
||||
/*
|
||||
Don't allow fetching of date/time/ts to non-string types
|
||||
@ -4829,6 +4839,13 @@ my_bool STDCALL mysql_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
|
||||
|
||||
for (param= stmt->bind, end= param+bind_count; param < end ; param++)
|
||||
{
|
||||
/*
|
||||
Set param->is_null to point to a dummy variable if it's not set.
|
||||
This is to make the excute code easier
|
||||
*/
|
||||
if (!param->is_null)
|
||||
param->is_null= &int_is_null_dummy;
|
||||
|
||||
/* Setup data copy functions for the different supported types */
|
||||
switch (param->buffer_type) {
|
||||
case MYSQL_TYPE_TINY:
|
||||
@ -4855,10 +4872,12 @@ my_bool STDCALL mysql_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
|
||||
case MYSQL_TYPE_BLOB:
|
||||
case MYSQL_TYPE_VAR_STRING:
|
||||
case MYSQL_TYPE_STRING:
|
||||
DBUG_ASSERT(param->buffer_length != 0);
|
||||
param->fetch_result= fetch_result_str;
|
||||
break;
|
||||
default:
|
||||
sprintf(stmt->last_error, ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
|
||||
sprintf(stmt->last_error,
|
||||
ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
|
||||
param->buffer_type, param->param_number);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
@ -4884,8 +4903,8 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
|
||||
return 0;
|
||||
|
||||
null_ptr= row;
|
||||
row+= (stmt->field_count+9)/8; /* skip null bits */
|
||||
bit= 4; /* first 2 bits are reserved */
|
||||
row+= (stmt->field_count+9)/8; /* skip null bits */
|
||||
bit= 4; /* first 2 bits are reserved */
|
||||
|
||||
/* Copy complete row to application buffers */
|
||||
for (bind= stmt->bind, end= (MYSQL_BIND *) bind + stmt->field_count,
|
||||
@ -4895,15 +4914,16 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
|
||||
bind++, field++)
|
||||
{
|
||||
if (*null_ptr & bit)
|
||||
*bind->length= MYSQL_NULL_DATA;
|
||||
*bind->is_null= 1;
|
||||
else
|
||||
{
|
||||
*bind->is_null= 0;
|
||||
if (field->type == bind->buffer_type)
|
||||
(*bind->fetch_result)(bind, &row);
|
||||
else if (fetch_results(stmt, bind, field->type, &row))
|
||||
return 1;
|
||||
}
|
||||
if (! (bit<<=1) & 255)
|
||||
if (! ((bit<<=1) & 255))
|
||||
{
|
||||
bit= 1; /* To next byte */
|
||||
null_ptr++;
|
||||
|
@ -107,7 +107,6 @@ EXPORTS
|
||||
getopt_ull_limit_value
|
||||
getopt_compare_strings
|
||||
mysql_warning_count
|
||||
mysql_warnings
|
||||
mysql_prepare
|
||||
mysql_execute
|
||||
mysql_param_count
|
||||
@ -119,7 +118,6 @@ EXPORTS
|
||||
mysql_stmt_errno
|
||||
mysql_fetch
|
||||
mysql_send_long_data
|
||||
mysql_multi_query
|
||||
mysql_next_result
|
||||
mysql_commit
|
||||
mysql_rollback
|
||||
|
@ -215,7 +215,6 @@ check_connections2(THD * thd)
|
||||
static bool check_user(THD *thd,enum_server_command command, const char *user,
|
||||
const char *passwd, const char *db, bool check_count)
|
||||
{
|
||||
USER_RESOURCES ur;
|
||||
thd->db=0;
|
||||
|
||||
if (!(thd->user = my_strdup(user, MYF(0))))
|
||||
|
@ -1,8 +1,8 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (id int not null, str char(10), unique(str));
|
||||
explain select * from t1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 system NULL NULL NULL NULL 0 const row not found
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
|
||||
insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar");
|
||||
select * from t1 where str is null;
|
||||
id str
|
||||
|
@ -31,12 +31,12 @@ select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75
|
||||
id id
|
||||
NULL 75
|
||||
explain select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
|
||||
t2 ALL NULL NULL NULL NULL 3 Using where
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id <0 and t1.id > 0;
|
||||
Comment
|
||||
Impossible WHERE noticed after reading const tables
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "mysys_priv.h"
|
||||
#include "my_static.h"
|
||||
#include "mysys_err.h"
|
||||
#include <m_string.h>
|
||||
|
||||
/*
|
||||
Alloc for things we don't nead to free
|
||||
|
@ -455,7 +455,7 @@ void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs,
|
||||
(each path from root to leaf has the same length)
|
||||
*/
|
||||
ha_rows tree_record_pos(TREE *tree, const void *key,
|
||||
enum ha_rkey_function flag, void *custom_arg)
|
||||
enum ha_rkey_function flag, void *custom_arg)
|
||||
{
|
||||
int cmp;
|
||||
TREE_ELEMENT *element= tree->root;
|
||||
@ -470,7 +470,7 @@ ha_rows tree_record_pos(TREE *tree, const void *key,
|
||||
{
|
||||
switch (flag) {
|
||||
case HA_READ_KEY_EXACT:
|
||||
last_equal_pos= (left + right) / 2;
|
||||
last_equal_pos= (ha_rows) ((left + right) / 2);
|
||||
cmp= 1;
|
||||
break;
|
||||
case HA_READ_BEFORE_KEY:
|
||||
@ -498,9 +498,9 @@ ha_rows tree_record_pos(TREE *tree, const void *key,
|
||||
case HA_READ_KEY_EXACT:
|
||||
return last_equal_pos;
|
||||
case HA_READ_BEFORE_KEY:
|
||||
return (uint) right;
|
||||
return (ha_rows) right;
|
||||
case HA_READ_AFTER_KEY:
|
||||
return (uint) left;
|
||||
return (ha_rows) left;
|
||||
default:
|
||||
return HA_POS_ERROR;
|
||||
}
|
||||
|
@ -2053,7 +2053,8 @@ String *Field_longlong::val_str(String *val_buffer,
|
||||
#endif
|
||||
longlongget(j,ptr);
|
||||
|
||||
length=(uint) cs->longlong10_to_str(cs,to,mlength,unsigned_flag ? 10 : -10, j);
|
||||
length=(uint) (cs->longlong10_to_str)(cs,to,mlength,
|
||||
unsigned_flag ? 10 : -10, j);
|
||||
val_buffer->length(length);
|
||||
if (zerofill)
|
||||
prepend_zeros(val_buffer);
|
||||
@ -3928,7 +3929,7 @@ int Field_string::store(longlong nr)
|
||||
char buff[64];
|
||||
int l;
|
||||
CHARSET_INFO *cs=charset();
|
||||
l=cs->longlong10_to_str(cs,buff,sizeof(buff),-10,nr);
|
||||
l= (cs->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr);
|
||||
return Field_string::store(buff,(uint)l,cs);
|
||||
}
|
||||
|
||||
@ -4095,7 +4096,7 @@ int Field_varstring::store(longlong nr)
|
||||
char buff[64];
|
||||
int l;
|
||||
CHARSET_INFO *cs=charset();
|
||||
l=cs->longlong10_to_str(cs,buff,sizeof(buff),-10,nr);
|
||||
l= (cs->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr);
|
||||
return Field_varstring::store(buff,(uint)l,cs);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#endif
|
||||
#include <m_ctype.h>
|
||||
#include "sql_sort.h"
|
||||
#include "assert.h"
|
||||
|
||||
#ifndef THREAD
|
||||
#define SKIP_DBUG_IN_FILESORT
|
||||
|
@ -55,7 +55,6 @@
|
||||
#ifdef HAVE_BERKELEY_DB
|
||||
#include <m_ctype.h>
|
||||
#include <myisampack.h>
|
||||
#include <assert.h>
|
||||
#include <hash.h>
|
||||
#include "ha_berkeley.h"
|
||||
#include "sql_manager.h"
|
||||
|
@ -32,7 +32,6 @@ InnoDB */
|
||||
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
#include <m_ctype.h>
|
||||
#include <assert.h>
|
||||
#include <hash.h>
|
||||
#include <myisampack.h>
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "mysql_priv.h"
|
||||
#include <m_ctype.h>
|
||||
#include "my_dir.h"
|
||||
#include <assert.h>
|
||||
|
||||
/*****************************************************************************
|
||||
** Item functions
|
||||
@ -1056,7 +1055,8 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
|
||||
break;
|
||||
if ((tmp= find_field_in_tables(thd, this,
|
||||
sl->get_table_list(), &where,
|
||||
0)) != not_found_field);
|
||||
0)) != not_found_field)
|
||||
break;
|
||||
if (sl->master_unit()->first_select()->linkage ==
|
||||
DERIVED_TABLE_TYPE)
|
||||
break; // do not look over derived table
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
#include "mysql_priv.h"
|
||||
#include <m_ctype.h>
|
||||
#include "assert.h"
|
||||
Item_bool_func2* Item_bool_func2::eq_creator(Item *a, Item *b)
|
||||
{
|
||||
return new Item_func_eq(a, b);
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <time.h>
|
||||
#include <ft_global.h>
|
||||
#include <zlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
/* return TRUE if item is a constant */
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include "mysql_priv.h"
|
||||
#include "assert.h"
|
||||
|
||||
Item_row::Item_row(List<Item> &arg):
|
||||
Item(), used_tables_cache(0), array_holder(1), const_item_cache(1)
|
||||
|
@ -1321,12 +1321,14 @@ String *Item_func_password::val_str(String *str)
|
||||
char* seed_ptr=key->c_ptr();
|
||||
while (*seed_ptr)
|
||||
{
|
||||
seed=seed*211+*seed_ptr; /* Use simple hashing */
|
||||
seed=(seed*211+*seed_ptr) & 0xffffffffL; /* Use simple hashing */
|
||||
seed_ptr++;
|
||||
}
|
||||
|
||||
/* Use constants which allow nice random values even with small seed */
|
||||
randominit(&rand_st,seed*111111+33333333L,seed*1111+55555555L);
|
||||
randominit(&rand_st,
|
||||
(ulong) ((ulonglong) seed*111111+33333333L) & (ulong) 0xffffffff,
|
||||
(ulong) ((ulonglong) seed*1111+55555555L) & (ulong) 0xffffffff);
|
||||
|
||||
make_scrambled_password(tmp_value,res->c_ptr(),use_old_passwords,
|
||||
&rand_st);
|
||||
|
@ -494,7 +494,7 @@ void Item_in_subselect::single_value_transformer(THD *thd,
|
||||
else
|
||||
{
|
||||
sl->item_list.empty();
|
||||
sl->item_list.push_back(new Item_int(1));
|
||||
sl->item_list.push_back(new Item_int("Not_used", (longlong) 1, 21));
|
||||
if (sl->table_list.elements)
|
||||
{
|
||||
item= (*func)(expr, new Item_asterisk_remover(this, item,
|
||||
|
@ -22,7 +22,7 @@
|
||||
#endif
|
||||
|
||||
#include "mysql_priv.h"
|
||||
#include "assert.h"
|
||||
|
||||
Item_sum::Item_sum(List<Item> &list)
|
||||
{
|
||||
arg_count=list.elements;
|
||||
|
@ -136,7 +136,7 @@ static SYMBOL symbols[] = {
|
||||
{ "DROP", SYM(DROP),0,0},
|
||||
{ "DUMPFILE", SYM(DUMPFILE),0,0},
|
||||
{ "DYNAMIC", SYM(DYNAMIC_SYM),0,0},
|
||||
{ "DUPLICATE", SYM(DUPLICATE),0,0},
|
||||
{ "DUPLICATE", SYM(DUPLICATE_SYM),0,0},
|
||||
{ "ERRORS", SYM(ERRORS),0,0},
|
||||
{ "END", SYM(END),0,0},
|
||||
{ "ELSE", SYM(ELSE),0,0},
|
||||
|
@ -68,8 +68,7 @@ TODO:
|
||||
|
||||
#include "mysql_priv.h"
|
||||
#include <hash.h>
|
||||
#include <assert.h>
|
||||
#include <ha_myisammrg.h>
|
||||
#include "ha_myisammrg.h"
|
||||
#ifndef MASTER
|
||||
#include "../srclib/myisammrg/myrg_def.h"
|
||||
#else
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include <my_dir.h>
|
||||
#include <stdarg.h>
|
||||
#include <m_ctype.h> // For test_if_number
|
||||
#include <assert.h>
|
||||
|
||||
#define files_charset_info my_charset_latin1
|
||||
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include <my_dir.h>
|
||||
#endif /* MYSQL_CLIENT */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#define log_cs my_charset_latin1
|
||||
|
||||
/*****************************************************************************
|
||||
@ -1652,7 +1650,7 @@ void Rotate_log_event::pack_info(Protocol *protocol)
|
||||
memcpy(buf, new_log_ident, ident_len);
|
||||
b_pos+= ident_len;
|
||||
b_pos= strmov(b_pos, ";pos=");
|
||||
b_pos=int10_to_str(pos, b_pos, 10);
|
||||
b_pos=longlong10_to_str(pos, b_pos, 10);
|
||||
if (flags & LOG_EVENT_FORCED_ROTATE_F)
|
||||
b_pos= strmov(b_pos ,"; forced by master");
|
||||
protocol->store(buf, b_pos-buf);
|
||||
@ -1789,7 +1787,7 @@ void Intvar_log_event::pack_info(Protocol *protocol)
|
||||
char buf[64], *pos;
|
||||
pos= strmov(buf, get_var_type_name());
|
||||
*(pos++)='=';
|
||||
pos=int10_to_str(val, pos, -10);
|
||||
pos= longlong10_to_str(val, pos, -10);
|
||||
protocol->store(buf, pos-buf);
|
||||
}
|
||||
#endif // !MYSQL_CLIENT
|
||||
@ -2000,7 +1998,7 @@ void Slave_log_event::pack_info(Protocol *protocol)
|
||||
pos= strmov(pos, ",log=");
|
||||
pos= strmov(pos, master_log);
|
||||
pos= strmov(pos, ",pos=");
|
||||
pos= int10_to_str(master_pos, pos, 10);
|
||||
pos= longlong10_to_str(master_pos, pos, 10);
|
||||
protocol->store(buf, pos-buf);
|
||||
}
|
||||
#endif // !MYSQL_CLIENT
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <errno.h>
|
||||
static void my_aiowait(my_aio_result *result);
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <thr_lock.h>
|
||||
#include <my_base.h> /* Needed by field.h */
|
||||
#include <my_bitmap.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef __EMX__
|
||||
#undef write /* remove pthread.h macro definition for EMX */
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include <nisam.h>
|
||||
#include <thr_alarm.h>
|
||||
#include <ft_global.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define mysqld_charset my_charset_latin1
|
||||
|
||||
|
@ -33,8 +33,6 @@
|
||||
#include <m_ctype.h>
|
||||
#include <nisam.h>
|
||||
#include "sql_select.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#ifndef EXTRA_DEBUG
|
||||
#define test_rb_tree(A,B) {}
|
||||
|
@ -151,11 +151,8 @@ void create_random_string(int length,struct rand_struct *rand_st,char* target)
|
||||
{
|
||||
char* end=target+length;
|
||||
/* Use pointer arithmetics as it is faster way to do so. */
|
||||
while (target<end)
|
||||
{
|
||||
*target=rnd(rand_st)*94+33;
|
||||
target++;
|
||||
}
|
||||
for (; target<end ; target++)
|
||||
*target= (char) (rnd(rand_st)*94+33);
|
||||
}
|
||||
|
||||
|
||||
@ -296,7 +293,7 @@ void make_scrambled_password(char *to,const char *password,
|
||||
{
|
||||
to[0]=PVERSION41_CHAR; /* New passwords have version prefix */
|
||||
/* Rnd returns number from 0 to 1 so this would be good salt generation.*/
|
||||
salt=rnd(rand_st)*65535+1;
|
||||
salt=(unsigned short) (rnd(rand_st)*65535+1);
|
||||
/* Use only 2 first bytes from it */
|
||||
sprintf(to+1,"%04x",salt);
|
||||
/* First hasing is done without salt */
|
||||
@ -556,7 +553,7 @@ void get_hash_and_password(ulong* salt, uint8 pversion, char* hash, unsigned cha
|
||||
val=*(++salt);
|
||||
for (t=3; t>=0; t--)
|
||||
{
|
||||
bin_password[t]=val & 255;
|
||||
bin_password[t]= (char) (val & 255);
|
||||
val>>=8; /* Scroll 8 bits to get next part*/
|
||||
}
|
||||
bin_password+=4; /* Get to next 4 chars*/
|
||||
@ -575,8 +572,7 @@ void get_hash_and_password(ulong* salt, uint8 pversion, char* hash, unsigned cha
|
||||
val=*salt;
|
||||
for (t=3;t>=0;t--)
|
||||
{
|
||||
bp[t]=val%256;
|
||||
|
||||
bp[t]= (uchar) (val & 255);
|
||||
val>>=8; /* Scroll 8 bits to get next part*/
|
||||
}
|
||||
bp+=4; /* Get to next 4 chars*/
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
#include "mysql_priv.h"
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
/* Send a error string to client */
|
||||
|
||||
|
@ -930,7 +930,7 @@ err:
|
||||
|
||||
bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names)
|
||||
{
|
||||
char buff[80], *value, *error= 0;
|
||||
char buff[80], *error= 0;
|
||||
uint error_len= 0;
|
||||
String str(buff, sizeof(buff), system_charset_info), *res;
|
||||
|
||||
@ -938,7 +938,7 @@ bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names)
|
||||
{
|
||||
if (!(res= var->value->val_str(&str)))
|
||||
goto err;
|
||||
(long) var->save_result.ulong_value= (ulong)
|
||||
var->save_result.ulong_value= (ulong)
|
||||
find_set(enum_names, res->c_ptr(), res->length(), &error, &error_len);
|
||||
if (error_len)
|
||||
{
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "repl_failsafe.h"
|
||||
#include <thr_alarm.h>
|
||||
#include <my_dir.h>
|
||||
#include <assert.h>
|
||||
|
||||
bool use_slave_mask = 0;
|
||||
MY_BITMAP slave_error_mask;
|
||||
|
@ -66,7 +66,8 @@ Geometry::GClassInfo *Geometry::find_class(const char *name, size_t len)
|
||||
cur_rt < ci_collection_end; ++cur_rt)
|
||||
{
|
||||
if ((cur_rt->m_name[len] == 0) &&
|
||||
(strncasecmp(cur_rt->m_name, name, len) == 0))
|
||||
(default_charset_info->strncasecmp(default_charset_info,
|
||||
cur_rt->m_name, name, len) == 0))
|
||||
{
|
||||
return cur_rt;
|
||||
}
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "sql_acl.h"
|
||||
#include "hash_filo.h"
|
||||
#include <m_ctype.h>
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <my_dir.h>
|
||||
#include <hash.h>
|
||||
#include <nisam.h>
|
||||
#include <assert.h>
|
||||
#ifdef __WIN__
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
@ -307,7 +307,6 @@ TODO list:
|
||||
#else
|
||||
#include "../myisammrg/myrg_def.h"
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(EXTRA_DEBUG) && !defined(DBUG_OFF)
|
||||
#define MUTEX_LOCK(M) { DBUG_PRINT("lock", ("mutex lock 0x%lx", (ulong)(M))); \
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include <mysys_err.h>
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include "mysql_priv.h"
|
||||
#include "sql_select.h"
|
||||
#include <assert.h>
|
||||
|
||||
/* TODO:
|
||||
HANDLER blabla OPEN [ AS foobar ] [ (column-list) ]
|
||||
|
@ -382,7 +382,7 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
if ((res= send_header_2(protocol)) ||
|
||||
(count==0 &&
|
||||
(search_categories(thd, 0, &categories_list, 0)<0 &&
|
||||
(res= 1))) ||
|
||||
((res= 1)))) ||
|
||||
(res= send_variant_2_list(protocol,&categories_list,true)))
|
||||
goto end;
|
||||
}
|
||||
@ -396,7 +396,7 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
else if ((res= send_header_2(protocol)) ||
|
||||
(res= send_variant_2_list(protocol,&function_list,false)) ||
|
||||
(search_categories(thd, mask, &categories_list, 0)<0 &&
|
||||
(res=1)) ||
|
||||
((res=1))) ||
|
||||
(res= send_variant_2_list(protocol,&categories_list,true)))
|
||||
{
|
||||
goto end;
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "item_create.h"
|
||||
#include <m_ctype.h>
|
||||
#include <hash.h>
|
||||
#include <assert.h>
|
||||
|
||||
LEX_STRING tmp_table_alias= {(char*) "tmp-table",8};
|
||||
|
||||
@ -235,7 +234,9 @@ static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote)
|
||||
yyUnget(); // ptr points now after last token char
|
||||
tmp.length=lex->yytoklen=length;
|
||||
tmp.str=(char*) lex->thd->alloc(tmp.length+1);
|
||||
for (from= (byte*) lex->tok_start, to= tmp.str, end= to+length ; to != end ;)
|
||||
for (from= (byte*) lex->tok_start, to= (byte*) tmp.str, end= to+length ;
|
||||
to != end ;
|
||||
)
|
||||
{
|
||||
if ((*to++= *from++) == quote)
|
||||
from++; // Skip double quotes
|
||||
|
@ -303,7 +303,7 @@ public:
|
||||
st_select_lex* outer_select();
|
||||
st_select_lex* first_select() { return (st_select_lex*) slave; }
|
||||
st_select_lex_unit* next_unit() { return (st_select_lex_unit*) next; }
|
||||
void st_select_lex_unit::exclude_level();
|
||||
void exclude_level();
|
||||
|
||||
/* UNION methods */
|
||||
int prepare(THD *thd, select_result *result);
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <m_ctype.h>
|
||||
#include <myisam.h>
|
||||
#include <my_dir.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define files_charset_info system_charset_info
|
||||
|
||||
|
@ -67,7 +67,6 @@ Long data handling:
|
||||
#include "mysql_priv.h"
|
||||
#include "sql_acl.h"
|
||||
#include "sql_select.h" // for JOIN
|
||||
#include <assert.h> // for DEBUG_ASSERT()
|
||||
#include <m_ctype.h> // for isspace()
|
||||
|
||||
#define IS_PARAM_NULL(pos, param_no) pos[param_no/8] & (1 << param_no & 7)
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "log_event.h"
|
||||
#include "mini_client.h"
|
||||
#include <my_dir.h>
|
||||
#include <assert.h>
|
||||
|
||||
extern const char* any_db;
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include <m_ctype.h>
|
||||
#include <hash.h>
|
||||
#include <ft_global.h>
|
||||
#include <assert.h>
|
||||
|
||||
const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref",
|
||||
"MAYBE_REF","ALL","range","index","fulltext" };
|
||||
|
@ -100,7 +100,7 @@ bool String::set(longlong num, CHARSET_INFO *cs)
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
str_length=(uint32) cs->longlong10_to_str(cs,Ptr,l,-10,num);
|
||||
str_length=(uint32) (cs->longlong10_to_str)(cs,Ptr,l,-10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
@ -111,7 +111,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
str_length=(uint32) cs->longlong10_to_str(cs,Ptr,l,10,num);
|
||||
str_length=(uint32) (cs->longlong10_to_str)(cs,Ptr,l,10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ public:
|
||||
Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0;
|
||||
str_charset=cs;
|
||||
}
|
||||
bool String::set_latin1(const char *str, uint32 arg_length);
|
||||
bool set_latin1(const char *str, uint32 arg_length);
|
||||
inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs)
|
||||
{
|
||||
if (!alloced)
|
||||
|
@ -23,7 +23,6 @@
|
||||
#endif
|
||||
#include <hash.h>
|
||||
#include <myisam.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef __WIN__
|
||||
#include <io.h>
|
||||
|
@ -208,7 +208,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
|
||||
%token DES_KEY_FILE
|
||||
%token DISABLE_SYM
|
||||
%token DISTINCT
|
||||
%token DUPLICATE
|
||||
%token DUPLICATE_SYM
|
||||
%token DYNAMIC_SYM
|
||||
%token ENABLE_SYM
|
||||
%token ENCLOSED
|
||||
@ -3177,7 +3177,7 @@ expr_or_default:
|
||||
|
||||
opt_insert_update:
|
||||
/* empty */
|
||||
| ON DUPLICATE
|
||||
| ON DUPLICATE_SYM
|
||||
{ /* for simplisity, let's forget about
|
||||
INSERT ... SELECT ... UPDATE
|
||||
for a moment */
|
||||
@ -3866,8 +3866,9 @@ keyword:
|
||||
| DES_KEY_FILE {}
|
||||
| DIRECTORY_SYM {}
|
||||
| DO_SYM {}
|
||||
| DUMPFILE {}
|
||||
| DUAL_SYM {}
|
||||
| DUMPFILE {}
|
||||
| DUPLICATE_SYM {}
|
||||
| DYNAMIC_SYM {}
|
||||
| END {}
|
||||
| ENUM {}
|
||||
@ -4565,11 +4566,7 @@ optional_order_or_limit:
|
||||
{
|
||||
THD *thd= YYTHD;
|
||||
LEX *lex= &thd->lex;
|
||||
if (!lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
|
||||
{
|
||||
send_error(lex->thd, ER_SYNTAX_ERROR);
|
||||
YYABORT;
|
||||
}
|
||||
DBUG_ASSERT(lex->current_select->linkage != GLOBAL_OPTIONS_TYPE);
|
||||
SELECT_LEX *sel= lex->current_select->select_lex();
|
||||
sel->master_unit()->global_parameters=
|
||||
sel->master_unit();
|
||||
|
@ -105,9 +105,9 @@ static int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
|
||||
unsigned char *s,
|
||||
unsigned char *e __attribute__((unused)))
|
||||
{
|
||||
if ( wc<256 )
|
||||
if (wc < 256)
|
||||
{
|
||||
s[0]=wc;
|
||||
s[0]= (char) wc;
|
||||
return 1;
|
||||
}
|
||||
return MY_CS_ILUNI;
|
||||
@ -296,7 +296,7 @@ static CHARSET_INFO my_charset_bin_st =
|
||||
my_strncasecmp_bin, /* strncasecmp */
|
||||
my_hash_caseup_bin, /* hash_caseup */
|
||||
my_hash_sort_bin, /* hash_sort */
|
||||
255, /* max_sort_char */
|
||||
(char) 255, /* max_sort_char */
|
||||
my_snprintf_8bit, /* snprintf */
|
||||
my_long10_to_str_8bit,
|
||||
my_longlong10_to_str_8bit,
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include <my_global.h>
|
||||
#include "m_ctype.h"
|
||||
#include "m_string.h"
|
||||
|
||||
#ifdef USE_MB
|
||||
|
||||
|
@ -4018,7 +4018,7 @@ static int fill_uchar(uchar *a,uint size,const char *str, uint len)
|
||||
for ( ; (s < e) && !strchr(" \t\r\n",s[0]); s++) ;
|
||||
if (s == b || i > size)
|
||||
break;
|
||||
a[i]= my_strntoul(my_charset_latin1,b,s-b,16,NULL,&err);
|
||||
a[i]= (uchar) my_strntoul(my_charset_latin1,b,s-b,16,NULL,&err);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -4036,7 +4036,7 @@ static int fill_uint16(uint16 *a,uint size,const char *str, uint len)
|
||||
for ( ; (s < e) && !strchr(" \t\r\n",s[0]); s++) ;
|
||||
if (s == b || i > size)
|
||||
break;
|
||||
a[i]= my_strntol(my_charset_latin1,b,s-b,16,NULL,&err);
|
||||
a[i]= (uint16) my_strntol(my_charset_latin1,b,s-b,16,NULL,&err);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
1293
tests/client_test.c
1293
tests/client_test.c
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user