merge with 3.23.51
BitKeeper/etc/logging_ok: auto-union BUILD/SETUP.sh: Auto merged Docs/manual.texi: Auto merged extra/resolveip.c: Auto merged include/my_sys.h: Auto merged mysql-test/t/type_enum.test: Auto merged mysys/mf_strip.c: Auto merged mysys/raid.cc: Auto merged include/my_net.h: merge mysql-test/r/type_enum.result: merge mysql-test/t/type_decimal.test: merge mysys/Makefile.am: merge sql/sql_db.cc: merge sql/sql_parse.cc: merge
This commit is contained in:
commit
766038f277
@ -49813,6 +49813,9 @@ not yet 100% confident in this code.
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
Remove end space from @code{enum} values. (This fixed a problem with
|
||||
@code{SHOW CREATE TABLE}).
|
||||
@item
|
||||
Fixed bug in @code{CONCAT_WS()} that cut the result.
|
||||
@item
|
||||
Changed name of variables @code{Com_show_master_stat} to
|
||||
|
@ -32,11 +32,6 @@
|
||||
#include <netdb.h>
|
||||
#include <my_getopt.h>
|
||||
|
||||
#ifdef SCO
|
||||
#undef h_errno
|
||||
#define h_errno errno
|
||||
#endif
|
||||
|
||||
#if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno)
|
||||
extern int h_errno;
|
||||
#endif
|
||||
|
@ -71,19 +71,22 @@ void my_inet_ntoa(struct in_addr in, char *buf);
|
||||
Handling of gethostbyname_r()
|
||||
*/
|
||||
|
||||
#if defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
|
||||
#if !defined(HPUX)
|
||||
struct hostent;
|
||||
#endif /* HPUX */
|
||||
#if !defined(HAVE_GETHOSTBYNAME_R)
|
||||
struct hostent *my_gethostbyname_r(const char *name,
|
||||
struct hostent *result, char *buffer,
|
||||
int buflen, int *h_errnop);
|
||||
void my_gethostbyname_r_free();
|
||||
#elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
|
||||
struct hostent *my_gethostbyname_r(const char *name,
|
||||
struct hostent *result, char *buffer,
|
||||
int buflen, int *h_errnop);
|
||||
#define my_gethostbyname_r_free()
|
||||
#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
|
||||
#define GETHOSTBYNAME_BUFF_SIZE 2048
|
||||
#else
|
||||
#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
|
||||
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
|
||||
#endif /* defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
|
||||
#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
|
||||
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
|
||||
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
|
||||
@ -91,17 +94,20 @@ struct hostent *my_gethostbyname_r(const char *name,
|
||||
struct hostent *result, char *buffer,
|
||||
int buflen, int *h_errnop);
|
||||
#define my_gethostbyname_r_free()
|
||||
#elif !defined(HAVE_GETHOSTBYNAME_R)
|
||||
#define GETHOSTBYNAME_BUFF_SIZE 2048
|
||||
struct hostent *my_gethostbyname_r(const char *name,
|
||||
struct hostent *result, char *buffer,
|
||||
int buflen, int *h_errnop);
|
||||
void my_gethostbyname_r_free();
|
||||
#else
|
||||
#define GETHOSTBYNAME_BUFF_SIZE 2048
|
||||
#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
|
||||
#define my_gethostbyname_r_free()
|
||||
#endif /* defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
|
||||
#endif /* !defined(HAVE_GETHOSTBYNAME_R) */
|
||||
|
||||
#ifndef GETHOSTBYNAME_BUFF_SIZE
|
||||
#define GETHOSTBYNAME_BUFF_SIZE 2048
|
||||
#endif
|
||||
|
||||
/* On SCO you get a link error when refering to h_errno */
|
||||
#ifdef SCO
|
||||
#undef h_errno
|
||||
#define h_errno errno
|
||||
#endif
|
||||
|
||||
C_MODE_END
|
||||
#endif
|
||||
|
@ -591,7 +591,7 @@ extern int my_sortncmp(const char *s,uint s_len, const char *t,uint t_len);
|
||||
extern WF_PACK *wf_comp(my_string str);
|
||||
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
|
||||
extern void wf_end(struct wild_file_pack *buffer);
|
||||
extern size_s stripp_sp(my_string str);
|
||||
extern size_s strip_sp(my_string str);
|
||||
extern void get_date(my_string to,int timeflag,time_t use_time);
|
||||
extern void soundex(my_string out_pntr, my_string in_pntr,pbool remove_garbage);
|
||||
extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file,
|
||||
|
8
mysql-test/r/type_set.result
Normal file
8
mysql-test/r/type_set.result
Normal file
@ -0,0 +1,8 @@
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` set('','a','b') NOT NULL default ''
|
||||
) TYPE=MyISAM
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` set('','a','b') NOT NULL default 'b'
|
||||
) TYPE=MyISAM
|
@ -183,7 +183,7 @@ drop table t1;
|
||||
|
||||
|
||||
create table t1 (a decimal(10,2));
|
||||
# The -0.0 needs to be typed as not all platforms supports this
|
||||
# The -0.0 needs to be quoted as not all platforms supports this
|
||||
insert into t1 values (0.0),("-0.0"),(+0.0),(01.0),(+01.0),(-01.0);
|
||||
insert into t1 values (-.1),(+.1),(.1);
|
||||
insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
|
||||
|
File diff suppressed because one or more lines are too long
10
mysql-test/t/type_set.test
Normal file
10
mysql-test/t/type_set.test
Normal file
@ -0,0 +1,10 @@
|
||||
#
|
||||
# Test of SET with space
|
||||
#
|
||||
|
||||
create table t1 (a set (' ','a','b') not null);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 (a set (' ','a','b ') not null default 'b ');
|
||||
show create table t1;
|
||||
drop table t1;
|
@ -35,7 +35,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
|
||||
my_error.c errors.c my_div.c my_messnc.c \
|
||||
mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \
|
||||
my_symlink.c my_symlink2.c \
|
||||
mf_pack.c mf_unixpath.c mf_stripp.c \
|
||||
mf_pack.c mf_unixpath.c mf_strip.c \
|
||||
mf_casecnv.c mf_soundex.c mf_wcomp.c mf_wfile.c \
|
||||
mf_qsort.c mf_qsort2.c mf_sort.c \
|
||||
ptr_cmp.c mf_radix.c queues.c \
|
||||
@ -45,7 +45,8 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
|
||||
my_chsize.c my_lread.c my_lwrite.c my_clock.c \
|
||||
my_quick.c my_lockmem.c my_static.c \
|
||||
my_getopt.c getvar.c my_mkdir.c \
|
||||
default.c my_compress.c checksum.c raid.cc my_net.c \
|
||||
default.c my_compress.c checksum.c raid.cc raid2.c \
|
||||
my_net.c \
|
||||
my_vsnprintf.c charset.c my_bitmap.c my_bit.c md5.c \
|
||||
my_gethostbyname.c
|
||||
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include "mysys_priv.h"
|
||||
|
||||
/*
|
||||
stripp_sp(my_string str)
|
||||
strip_sp(my_string str)
|
||||
Strips end-space from string and returns new length.
|
||||
*/
|
||||
|
||||
size_s stripp_sp(register my_string str)
|
||||
size_s strip_sp(register my_string str)
|
||||
{
|
||||
reg2 my_string found;
|
||||
reg3 my_string start;
|
||||
@ -43,4 +43,4 @@ size_s stripp_sp(register my_string str)
|
||||
}
|
||||
*found= '\0'; /* Stripp at first space */
|
||||
return (size_s) (found-start);
|
||||
} /* stripp_sp */
|
||||
} /* strip_sp */
|
31
mysys/raid2.c
Normal file
31
mysys/raid2.c
Normal file
@ -0,0 +1,31 @@
|
||||
/* Copyright (C) 2002 MySQL AB
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
|
||||
/*
|
||||
RAID support for MySQL. For full comments, check raid.cc
|
||||
This is in a separate file to not cause problems on OS that can't
|
||||
put C++ files in archives.
|
||||
*/
|
||||
|
||||
#include "mysys_priv.h"
|
||||
|
||||
const char *raid_type_string[]={"none","striped"};
|
||||
|
||||
const char *my_raid_type(int raid_type)
|
||||
{
|
||||
return raid_type_string[raid_type];
|
||||
}
|
@ -332,7 +332,7 @@ bool mysql_change_db(THD *thd,const char *name)
|
||||
uint db_access;
|
||||
DBUG_ENTER("mysql_change_db");
|
||||
|
||||
if (!dbname || !(db_length=stripp_sp(dbname)))
|
||||
if (!dbname || !(db_length=strip_sp(dbname)))
|
||||
{
|
||||
x_free(dbname); /* purecov: inspected */
|
||||
send_error(&thd->net,ER_NO_DB_ERROR); /* purecov: inspected */
|
||||
|
@ -1047,7 +1047,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
thread_safe_increment(com_stat[SQLCOM_CREATE_DB],&LOCK_thread_count);
|
||||
char *db=thd->strdup(packet);
|
||||
// null test to handle EOM
|
||||
if (!db || !stripp_sp(db) || check_db_name(db))
|
||||
if (!db || !strip_sp(db) || check_db_name(db))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, db ? db : "NULL");
|
||||
break;
|
||||
@ -1063,7 +1063,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
thread_safe_increment(com_stat[SQLCOM_DROP_DB],&LOCK_thread_count);
|
||||
char *db=thd->strdup(packet);
|
||||
// null test to handle EOM
|
||||
if (!db || !stripp_sp(db) || check_db_name(db))
|
||||
if (!db || !strip_sp(db) || check_db_name(db))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, db ? db : "NULL");
|
||||
break;
|
||||
@ -2241,7 +2241,7 @@ mysql_execute_command(void)
|
||||
break;
|
||||
case SQLCOM_CREATE_DB:
|
||||
{
|
||||
if (!stripp_sp(lex->name) || check_db_name(lex->name))
|
||||
if (!strip_sp(lex->name) || check_db_name(lex->name))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, lex->name);
|
||||
break;
|
||||
@ -2253,7 +2253,7 @@ mysql_execute_command(void)
|
||||
}
|
||||
case SQLCOM_DROP_DB:
|
||||
{
|
||||
if (!stripp_sp(lex->name) || check_db_name(lex->name))
|
||||
if (!strip_sp(lex->name) || check_db_name(lex->name))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, lex->name);
|
||||
break;
|
||||
@ -2991,7 +2991,9 @@ bool add_field_to_list(char *field_name, enum_field_types type,
|
||||
new_field->interval=interval;
|
||||
new_field->length=0;
|
||||
for (const char **pos=interval->type_names; *pos ; pos++)
|
||||
new_field->length+=(uint) strlen(*pos)+1;
|
||||
{
|
||||
new_field->length+=(uint) strip_sp((char*) *pos)+1;
|
||||
}
|
||||
new_field->length--;
|
||||
set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1);
|
||||
if (default_value)
|
||||
@ -3012,10 +3014,10 @@ bool add_field_to_list(char *field_name, enum_field_types type,
|
||||
{
|
||||
new_field->interval=interval;
|
||||
new_field->pack_length=interval->count < 256 ? 1 : 2; // Should be safe
|
||||
new_field->length=(uint) strlen(interval->type_names[0]);
|
||||
new_field->length=(uint) strip_sp((char*) interval->type_names[0]);
|
||||
for (const char **pos=interval->type_names+1; *pos ; pos++)
|
||||
{
|
||||
uint length=(uint) strlen(*pos);
|
||||
uint length=(uint) strip_sp((char*) *pos);
|
||||
set_if_bigger(new_field->length,length);
|
||||
}
|
||||
set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user