Merge sinisa@work.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1
This commit is contained in:
commit
fdbfc98204
@ -96,4 +96,5 @@ wax@mysql.com
|
||||
worm@altair.is.lan
|
||||
zak@balfor.local
|
||||
zak@linux.local
|
||||
zak@mysql.com
|
||||
zgreant@mysql.com
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <signal.h>
|
||||
#include <violite.h>
|
||||
|
||||
const char *VER= "13.0";
|
||||
const char *VER= "13.1";
|
||||
|
||||
/* Don't try to make a nice table if the data is too big */
|
||||
#define MAX_COLUMN_LENGTH 1024
|
||||
@ -195,6 +195,7 @@ static void end_pager();
|
||||
static int init_tee(char *);
|
||||
static void end_tee();
|
||||
static const char* construct_prompt();
|
||||
static char *get_arg(char *line);
|
||||
static void init_username();
|
||||
static void add_int_to_prompt(int toadd);
|
||||
|
||||
@ -2313,18 +2314,14 @@ com_use(String *buffer __attribute__((unused)), char *line)
|
||||
char *tmp;
|
||||
char buff[256];
|
||||
|
||||
while (my_isspace(system_charset_info,*line))
|
||||
line++;
|
||||
strnmov(buff,line,sizeof(buff)-1); // Don't destroy history
|
||||
if (buff[0] == '\\') // Short command
|
||||
buff[1]=' ';
|
||||
tmp=(char *) strtok(buff," \t;"); // Skip connect command
|
||||
if (!tmp || !(tmp=(char *) strtok(NullS," \t;")))
|
||||
strmov(buff, line);
|
||||
tmp= get_arg(buff);
|
||||
if (!tmp || !*tmp)
|
||||
{
|
||||
put_info("USE must be followed by a database name",INFO_ERROR);
|
||||
put_info("USE must be followed by a database name", INFO_ERROR);
|
||||
return 0;
|
||||
}
|
||||
if (!current_db || cmp_database(current_db,tmp))
|
||||
if (!current_db || cmp_database(current_db, tmp))
|
||||
{
|
||||
if (one_database)
|
||||
skip_updates= 1;
|
||||
@ -2360,6 +2357,62 @@ com_use(String *buffer __attribute__((unused)), char *line)
|
||||
}
|
||||
|
||||
|
||||
enum quote_type { NO_QUOTE, SQUOTE, DQUOTE, BTICK };
|
||||
|
||||
char *get_arg(char *line)
|
||||
{
|
||||
char *ptr;
|
||||
my_bool quoted= 0, valid_arg= 0;
|
||||
uint count= 0;
|
||||
enum quote_type qtype= NO_QUOTE;
|
||||
|
||||
ptr= line;
|
||||
/* skip leading white spaces */
|
||||
while (my_isspace(system_charset_info, *ptr))
|
||||
ptr++;
|
||||
if (*ptr == '\\') // short command was used
|
||||
ptr+= 2;
|
||||
while (!my_isspace(system_charset_info, *ptr)) // skip command
|
||||
ptr++;
|
||||
while (my_isspace(system_charset_info, *ptr))
|
||||
ptr++;
|
||||
if ((*ptr == '\'' && (qtype= SQUOTE)) ||
|
||||
(*ptr == '\"' && (qtype= DQUOTE)) ||
|
||||
(*ptr == '`' && (qtype= BTICK)))
|
||||
{
|
||||
quoted= 1;
|
||||
ptr++;
|
||||
}
|
||||
for (; ptr && *ptr; ptr++, count++)
|
||||
{
|
||||
if (*ptr == '\\') // escaped character
|
||||
{
|
||||
// jump over the backslash
|
||||
char *tmp_ptr, tmp_buff[256];
|
||||
tmp_ptr= strmov(tmp_buff, (ptr - count));
|
||||
tmp_ptr-= (strlen(tmp_buff) - count);
|
||||
strmov(tmp_ptr, (ptr + 1));
|
||||
strmov(line, tmp_buff);
|
||||
ptr= line;
|
||||
ptr+= count;
|
||||
}
|
||||
else if (!quoted && *ptr == ' ')
|
||||
*(ptr + 1) = 0;
|
||||
else if ((*ptr == '\'' && qtype == SQUOTE) ||
|
||||
(*ptr == '\"' && qtype == DQUOTE) ||
|
||||
(*ptr == '`' && qtype == BTICK))
|
||||
{
|
||||
*ptr= 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (ptr-= count; ptr && *ptr; ptr++)
|
||||
if (!my_isspace(system_charset_info, *ptr))
|
||||
valid_arg= 1;
|
||||
return valid_arg ? ptr - count : '\0';
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
sql_real_connect(char *host,char *database,char *user,char *password,
|
||||
uint silent)
|
||||
|
@ -123,7 +123,9 @@ 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 (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt, ...);
|
||||
int (*l10tostr)(struct charset_info_st *, char *to, uint n, int radix, long int val);
|
||||
int (*ll10tostr)(struct charset_info_st *, char *to, uint n, int radix, longlong val);
|
||||
|
||||
long (*strntol)(struct charset_info_st *, const char *s, uint l,char **e, int base);
|
||||
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l, char **e, int base);
|
||||
@ -175,6 +177,9 @@ longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l,char **e, int
|
||||
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l,char **e, int base);
|
||||
double my_strntod_8bit(CHARSET_INFO *, const char *s, uint l,char **e);
|
||||
|
||||
int my_l10tostr_8bit(CHARSET_INFO *, char *to, uint l, int radix, long int val);
|
||||
int my_ll10tostr_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,
|
||||
|
@ -433,17 +433,7 @@ CONVERT *get_convert_set(const char *name)
|
||||
{
|
||||
for (CONVERT **ptr=convert_tables ; *ptr ; ptr++)
|
||||
{
|
||||
/*
|
||||
BAR TODO: Monty's comments:
|
||||
Why is this using system_charset_info ?
|
||||
Isn't the character-set string given in the users default charset?
|
||||
Please add a TODO note to the code that this has to be fixed when the user
|
||||
will be able to cast strings to different character sets...
|
||||
The current code will also not work if/when we introduce support for
|
||||
16 bit characters...
|
||||
(I know that there is a LOT of changes to do if we ever want do this...)
|
||||
*/
|
||||
if (!my_strcasecmp(system_charset_info,(*ptr)->name,name))
|
||||
if (!my_strcasecmp(my_charset_latin1,(*ptr)->name,name))
|
||||
return (*ptr);
|
||||
}
|
||||
return 0;
|
||||
|
127
sql/field.cc
127
sql/field.cc
@ -70,12 +70,14 @@ void Field_num::prepend_zeros(String *value)
|
||||
This is only used to give warnings in ALTER TABLE or LOAD DATA...
|
||||
*/
|
||||
|
||||
bool test_if_int(const char *str,int length)
|
||||
bool test_if_int(const char *str,int length, CHARSET_INFO *cs)
|
||||
{
|
||||
const char *end=str+length;
|
||||
|
||||
cs=system_charset_info; // QQ move test_if_int into CHARSET_INFO struct
|
||||
|
||||
// Allow start space
|
||||
while (str != end && my_isspace(system_charset_info,*str))
|
||||
while (str != end && my_isspace(cs,*str))
|
||||
str++; /* purecov: inspected */
|
||||
if (str != end && (*str == '-' || *str == '+'))
|
||||
str++;
|
||||
@ -83,7 +85,7 @@ bool test_if_int(const char *str,int length)
|
||||
return 0; // Error: Empty string
|
||||
for (; str != end ; str++)
|
||||
{
|
||||
if (!my_isdigit(system_charset_info,*str))
|
||||
if (!my_isdigit(cs,*str))
|
||||
{
|
||||
if (*str == '.')
|
||||
{ // Allow '.0000'
|
||||
@ -91,10 +93,10 @@ bool test_if_int(const char *str,int length)
|
||||
if (str == end)
|
||||
return 1;
|
||||
}
|
||||
if (!my_isspace(system_charset_info,*str))
|
||||
if (!my_isspace(cs,*str))
|
||||
return 0;
|
||||
for (str++ ; str != end ; str++)
|
||||
if (!my_isspace(system_charset_info,*str))
|
||||
if (!my_isspace(cs,*str))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
@ -103,9 +105,11 @@ bool test_if_int(const char *str,int length)
|
||||
}
|
||||
|
||||
|
||||
static bool test_if_real(const char *str,int length)
|
||||
static bool test_if_real(const char *str,int length, CHARSET_INFO *cs)
|
||||
{
|
||||
while (length && my_isspace(system_charset_info,*str))
|
||||
cs=system_charset_info; // QQ move test_if_int into CHARSET_INFO struct
|
||||
|
||||
while (length && my_isspace(cs,*str))
|
||||
{ // Allow start space
|
||||
length--; str++;
|
||||
}
|
||||
@ -114,10 +118,10 @@ static bool test_if_real(const char *str,int length)
|
||||
if (*str == '+' || *str == '-')
|
||||
{
|
||||
length--; str++;
|
||||
if (!length || !(my_isdigit(system_charset_info,*str) || *str == '.'))
|
||||
if (!length || !(my_isdigit(cs,*str) || *str == '.'))
|
||||
return 0;
|
||||
}
|
||||
while (length && my_isdigit(system_charset_info,*str))
|
||||
while (length && my_isdigit(cs,*str))
|
||||
{
|
||||
length--; str++;
|
||||
}
|
||||
@ -126,7 +130,7 @@ static bool test_if_real(const char *str,int length)
|
||||
if (*str == '.')
|
||||
{
|
||||
length--; str++;
|
||||
while (length && my_isdigit(system_charset_info,*str))
|
||||
while (length && my_isdigit(cs,*str))
|
||||
{
|
||||
length--; str++;
|
||||
}
|
||||
@ -136,18 +140,18 @@ static bool test_if_real(const char *str,int length)
|
||||
if (*str == 'E' || *str == 'e')
|
||||
{
|
||||
if (length < 3 || (str[1] != '+' && str[1] != '-') ||
|
||||
!my_isdigit(system_charset_info,str[2]))
|
||||
!my_isdigit(cs,str[2]))
|
||||
return 0;
|
||||
length-=3;
|
||||
str+=3;
|
||||
while (length && my_isdigit(system_charset_info,*str))
|
||||
while (length && my_isdigit(cs,*str))
|
||||
{
|
||||
length--; str++;
|
||||
}
|
||||
}
|
||||
for (; length ; length--, str++)
|
||||
{ // Allow end space
|
||||
if (!my_isspace(system_charset_info,*str))
|
||||
if (!my_isspace(cs,*str))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
@ -290,23 +294,23 @@ void Field::store_time(TIME *ltime,timestamp_type type)
|
||||
char buff[25];
|
||||
switch (type) {
|
||||
case TIMESTAMP_NONE:
|
||||
store("",0,default_charset_info); // Probably an error
|
||||
store("",0,my_charset_latin1); // Probably an error
|
||||
break;
|
||||
case TIMESTAMP_DATE:
|
||||
sprintf(buff,"%04d-%02d-%02d", ltime->year,ltime->month,ltime->day);
|
||||
store(buff,10,default_charset_info);
|
||||
store(buff,10,my_charset_latin1);
|
||||
break;
|
||||
case TIMESTAMP_FULL:
|
||||
sprintf(buff,"%04d-%02d-%02d %02d:%02d:%02d",
|
||||
ltime->year,ltime->month,ltime->day,
|
||||
ltime->hour,ltime->minute,ltime->second);
|
||||
store(buff,19,default_charset_info);
|
||||
store(buff,19,my_charset_latin1);
|
||||
break;
|
||||
case TIMESTAMP_TIME:
|
||||
{
|
||||
ulong length= my_sprintf(buff, (buff, "%02d:%02d:%02d",
|
||||
ltime->hour,ltime->minute,ltime->second));
|
||||
store(buff,(uint) length, default_charset_info);
|
||||
store(buff,(uint) length, my_charset_latin1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -326,7 +330,7 @@ bool Field::optimize_range(uint idx)
|
||||
void
|
||||
Field_decimal::reset(void)
|
||||
{
|
||||
Field_decimal::store("0",1,default_charset_info);
|
||||
Field_decimal::store("0",1,my_charset_latin1);
|
||||
}
|
||||
|
||||
void Field_decimal::overflow(bool negative)
|
||||
@ -923,7 +927,7 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
}
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
@ -943,7 +947,7 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
}
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
@ -1053,13 +1057,17 @@ longlong Field_tiny::val_int(void)
|
||||
String *Field_tiny::val_str(String *val_buffer,
|
||||
String *val_ptr __attribute__((unused)))
|
||||
{
|
||||
CHARSET_INFO *cs=current_thd->thd_charset;
|
||||
uint length;
|
||||
val_buffer->alloc(max(field_length+1,5));
|
||||
uint mlength=max(field_length+1,5*cs->mbmaxlen);
|
||||
val_buffer->alloc(mlength);
|
||||
char *to=(char*) val_buffer->ptr();
|
||||
|
||||
if (unsigned_flag)
|
||||
length= (uint) (int10_to_str((long) *((uchar*) ptr),to,10)-to);
|
||||
length= (uint) cs->l10tostr(cs,to,mlength, 10,(long) *((uchar*) ptr));
|
||||
else
|
||||
length= (uint) (int10_to_str((long) *((signed char*) ptr),to,-10)-to);
|
||||
length= (uint) cs->l10tostr(cs,to,mlength,-10,(long) *((signed char*) ptr));
|
||||
|
||||
val_buffer->length(length);
|
||||
if (zerofill)
|
||||
prepend_zeros(val_buffer);
|
||||
@ -1115,7 +1123,7 @@ int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
}
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
@ -1135,7 +1143,7 @@ int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
}
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
@ -1280,8 +1288,10 @@ longlong Field_short::val_int(void)
|
||||
String *Field_short::val_str(String *val_buffer,
|
||||
String *val_ptr __attribute__((unused)))
|
||||
{
|
||||
CHARSET_INFO *cs=current_thd->thd_charset;
|
||||
uint length;
|
||||
val_buffer->alloc(max(field_length+1,7));
|
||||
uint mlength=max(field_length+1,7*cs->mbmaxlen);
|
||||
val_buffer->alloc(mlength);
|
||||
char *to=(char*) val_buffer->ptr();
|
||||
short j;
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
@ -1292,9 +1302,9 @@ String *Field_short::val_str(String *val_buffer,
|
||||
shortget(j,ptr);
|
||||
|
||||
if (unsigned_flag)
|
||||
length=(uint) (int10_to_str((long) (uint16) j,to,10)-to);
|
||||
length=(uint) cs->l10tostr(cs,to,mlength, 10, (long) (uint16) j);
|
||||
else
|
||||
length=(uint) (int10_to_str((long) j,to,-10)-to);
|
||||
length=(uint) cs->l10tostr(cs,to,mlength,-10, (long) j);
|
||||
val_buffer->length(length);
|
||||
if (zerofill)
|
||||
prepend_zeros(val_buffer);
|
||||
@ -1378,7 +1388,7 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
}
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
@ -1398,7 +1408,7 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
}
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
@ -1513,12 +1523,14 @@ longlong Field_medium::val_int(void)
|
||||
String *Field_medium::val_str(String *val_buffer,
|
||||
String *val_ptr __attribute__((unused)))
|
||||
{
|
||||
CHARSET_INFO *cs=current_thd->thd_charset;
|
||||
uint length;
|
||||
val_buffer->alloc(max(field_length+1,10));
|
||||
uint mlength=max(field_length+1,10*cs->mbmaxlen);
|
||||
val_buffer->alloc(mlength);
|
||||
char *to=(char*) val_buffer->ptr();
|
||||
long j= unsigned_flag ? (long) uint3korr(ptr) : sint3korr(ptr);
|
||||
|
||||
length=(uint) (int10_to_str(j,to,-10)-to);
|
||||
length=(uint) cs->l10tostr(cs,to,mlength,-10,j);
|
||||
val_buffer->length(length);
|
||||
if (zerofill)
|
||||
prepend_zeros(val_buffer); /* purecov: inspected */
|
||||
@ -1593,7 +1605,7 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
tmp=my_strntol(cs,from,len,&end,10);
|
||||
if (errno ||
|
||||
(from+len != end && current_thd->count_cuted_fields &&
|
||||
!test_if_int(from,len)))
|
||||
!test_if_int(from,len,cs)))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
@ -1738,8 +1750,10 @@ longlong Field_long::val_int(void)
|
||||
String *Field_long::val_str(String *val_buffer,
|
||||
String *val_ptr __attribute__((unused)))
|
||||
{
|
||||
CHARSET_INFO *cs=current_thd->thd_charset;
|
||||
uint length;
|
||||
val_buffer->alloc(max(field_length+1,12));
|
||||
uint mlength=max(field_length+1,12*cs->mbmaxlen);
|
||||
val_buffer->alloc(mlength);
|
||||
char *to=(char*) val_buffer->ptr();
|
||||
int32 j;
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
@ -1749,9 +1763,10 @@ String *Field_long::val_str(String *val_buffer,
|
||||
#endif
|
||||
longget(j,ptr);
|
||||
|
||||
length=(uint) (int10_to_str((unsigned_flag ? (long) (uint32) j : (long) j),
|
||||
to,
|
||||
unsigned_flag ? 10 : -10)-to);
|
||||
if (unsigned_flag)
|
||||
length=cs->l10tostr(cs,to,mlength, 10,(long) (uint32)j);
|
||||
else
|
||||
length=cs->l10tostr(cs,to,mlength,-10,(long) j);
|
||||
val_buffer->length(length);
|
||||
if (zerofill)
|
||||
prepend_zeros(val_buffer);
|
||||
@ -1843,7 +1858,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
tmp=my_strntoll(cs,from,len,&end,10);
|
||||
if (errno ||
|
||||
(from+len != end && current_thd->count_cuted_fields &&
|
||||
!test_if_int(from,len)))
|
||||
!test_if_int(from,len,cs)))
|
||||
current_thd->cuted_fields++;
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
if (table->db_low_byte_first)
|
||||
@ -1952,8 +1967,10 @@ longlong Field_longlong::val_int(void)
|
||||
String *Field_longlong::val_str(String *val_buffer,
|
||||
String *val_ptr __attribute__((unused)))
|
||||
{
|
||||
CHARSET_INFO *cs=current_thd->thd_charset;
|
||||
uint length;
|
||||
val_buffer->alloc(max(field_length+1,22));
|
||||
uint mlength=max(field_length+1,22*cs->mbmaxlen);
|
||||
val_buffer->alloc(mlength);
|
||||
char *to=(char*) val_buffer->ptr();
|
||||
longlong j;
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
@ -1963,7 +1980,7 @@ String *Field_longlong::val_str(String *val_buffer,
|
||||
#endif
|
||||
longlongget(j,ptr);
|
||||
|
||||
length=(uint) (longlong10_to_str(j,to,unsigned_flag ? 10 : -10)-to);
|
||||
length=(uint) cs->ll10tostr(cs,to,mlength,unsigned_flag ? 10 : -10, j);
|
||||
val_buffer->length(length);
|
||||
if (zerofill)
|
||||
prepend_zeros(val_buffer);
|
||||
@ -2041,7 +2058,7 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
{
|
||||
errno=0;
|
||||
Field_float::store(my_strntod(cs,from,len,(char**)NULL));
|
||||
if (errno || current_thd->count_cuted_fields && !test_if_real(from,len))
|
||||
if (errno || current_thd->count_cuted_fields && !test_if_real(from,len,cs))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
return 1;
|
||||
@ -2303,7 +2320,7 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
errno=0;
|
||||
int error= 0;
|
||||
double j= my_strntod(cs,from,len,(char**)0);
|
||||
if (errno || current_thd->count_cuted_fields && !test_if_real(from,len))
|
||||
if (errno || current_thd->count_cuted_fields && !test_if_real(from,len,cs))
|
||||
{
|
||||
current_thd->cuted_fields++;
|
||||
error= 1;
|
||||
@ -3087,7 +3104,7 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
|
||||
current_thd->cuted_fields++;
|
||||
return 1;
|
||||
}
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
|
||||
else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
|
||||
current_thd->cuted_fields++;
|
||||
if (nr != 0 || len != 4)
|
||||
{
|
||||
@ -3772,15 +3789,17 @@ int Field_string::store(double nr)
|
||||
int width=min(field_length,DBL_DIG+5);
|
||||
sprintf(buff,"%-*.*g",width,max(width-5,0),nr);
|
||||
end=strcend(buff,' ');
|
||||
return Field_string::store(buff,(uint) (end - buff), default_charset_info);
|
||||
return Field_string::store(buff,(uint) (end - buff), my_charset_latin1);
|
||||
}
|
||||
|
||||
|
||||
int Field_string::store(longlong nr)
|
||||
{
|
||||
char buff[22];
|
||||
char *end=longlong10_to_str(nr,buff,-10);
|
||||
return Field_string::store(buff,(uint) (end-buff), default_charset_info);
|
||||
char buff[64];
|
||||
int l;
|
||||
CHARSET_INFO *cs=charset();
|
||||
l=cs->ll10tostr(cs,buff,sizeof(buff),-10,nr);
|
||||
return Field_string::store(buff,(uint)l,cs);
|
||||
}
|
||||
|
||||
|
||||
@ -3969,15 +3988,17 @@ int Field_varstring::store(double nr)
|
||||
int width=min(field_length,DBL_DIG+5);
|
||||
sprintf(buff,"%-*.*g",width,max(width-5,0),nr);
|
||||
end=strcend(buff,' ');
|
||||
return Field_varstring::store(buff,(uint) (end - buff), default_charset_info);
|
||||
return Field_varstring::store(buff,(uint) (end - buff), my_charset_latin1);
|
||||
}
|
||||
|
||||
|
||||
int Field_varstring::store(longlong nr)
|
||||
{
|
||||
char buff[22];
|
||||
char *end=longlong10_to_str(nr,buff,-10);
|
||||
return Field_varstring::store(buff,(uint) (end-buff), default_charset_info);
|
||||
char buff[64];
|
||||
int l;
|
||||
CHARSET_INFO *cs=charset();
|
||||
l=cs->ll10tostr(cs,buff,sizeof(buff),-10,nr);
|
||||
return Field_varstring::store(buff,(uint)l,cs);
|
||||
}
|
||||
|
||||
|
||||
@ -4533,7 +4554,7 @@ void Field_blob::sql_type(String &res) const
|
||||
case 3: str="medium"; break;
|
||||
case 4: str="long"; break;
|
||||
}
|
||||
res.set(str,(uint) strlen(str),default_charset_info);
|
||||
res.set(str,(uint) strlen(str),my_charset_latin1);
|
||||
res.append(binary() ? "blob" : "text");
|
||||
if (!binary())
|
||||
{
|
||||
@ -5297,7 +5318,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
|
||||
orig_field)
|
||||
{
|
||||
char buff[MAX_FIELD_WIDTH],*pos;
|
||||
CHARSET_INFO *field_charset= charset ? charset : default_charset_info;
|
||||
CHARSET_INFO *field_charset= charset;
|
||||
String tmp(buff,sizeof(buff),field_charset);
|
||||
|
||||
/* Get the value from record[2] (the default value row) */
|
||||
|
@ -1072,7 +1072,7 @@ bool set_field_to_null(Field *field);
|
||||
bool set_field_to_null_with_conversions(Field *field, bool no_conversions);
|
||||
uint find_enum(TYPELIB *typelib,const char *x, uint length);
|
||||
ulonglong find_set(TYPELIB *typelib,const char *x, uint length);
|
||||
bool test_if_int(const char *str,int length);
|
||||
bool test_if_int(const char *str,int length,CHARSET_INFO *cs);
|
||||
|
||||
/*
|
||||
The following are for the interface with the .frm file
|
||||
|
@ -263,7 +263,8 @@ static void do_conv_blob(Copy_field *copy)
|
||||
{
|
||||
copy->from_field->val_str(©->tmp,©->tmp);
|
||||
((Field_blob *) copy->to_field)->store(copy->tmp.ptr(),
|
||||
copy->tmp.length(),default_charset_info);
|
||||
copy->tmp.length(),
|
||||
copy->tmp.charset());
|
||||
}
|
||||
|
||||
/* Save blob in copy->tmp for GROUP BY */
|
||||
@ -275,7 +276,8 @@ static void do_save_blob(Copy_field *copy)
|
||||
copy->from_field->val_str(&res,&res);
|
||||
copy->tmp.copy(res);
|
||||
((Field_blob *) copy->to_field)->store(copy->tmp.ptr(),
|
||||
copy->tmp.length(),default_charset_info);
|
||||
copy->tmp.length(),
|
||||
copy->tmp.charset());
|
||||
}
|
||||
|
||||
|
||||
@ -284,7 +286,7 @@ static void do_field_string(Copy_field *copy)
|
||||
char buff[MAX_FIELD_WIDTH];
|
||||
copy->tmp.set_quick(buff,sizeof(buff),default_charset_info);
|
||||
copy->from_field->val_str(©->tmp,©->tmp);
|
||||
copy->to_field->store(copy->tmp.c_ptr_quick(),copy->tmp.length(),default_charset_info);
|
||||
copy->to_field->store(copy->tmp.c_ptr_quick(),copy->tmp.length(),copy->tmp.charset());
|
||||
}
|
||||
|
||||
|
||||
|
@ -108,9 +108,7 @@ Item_sum_int::val_str(String *str)
|
||||
longlong nr=val_int();
|
||||
if (null_value)
|
||||
return 0;
|
||||
char buff[21];
|
||||
uint length= (uint) (longlong10_to_str(nr,buff,-10)-buff);
|
||||
str->copy(buff,length,thd_charset());
|
||||
str->set(nr,thd_charset());
|
||||
return str;
|
||||
}
|
||||
|
||||
|
@ -4637,7 +4637,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
berkeley_lock_type=berkeley_lock_types[type-1];
|
||||
else
|
||||
{
|
||||
if (test_if_int(argument,(uint) strlen(argument)))
|
||||
if (test_if_int(argument,(uint) strlen(argument), my_charset_latin1))
|
||||
berkeley_lock_scan_time=atoi(argument);
|
||||
else
|
||||
{
|
||||
|
@ -2,7 +2,13 @@
|
||||
This file is public domain and comes with NO WARRANTY of any kind
|
||||
|
||||
Dirk Munzinger (dmun@4t2.com)
|
||||
Version: 07.06.2001 */
|
||||
Version: 07.06.2001
|
||||
|
||||
Georg Richter (georg@php.net)
|
||||
fixed typos and translation
|
||||
translated new error messages
|
||||
2002-12-11
|
||||
*/
|
||||
|
||||
"hashchk",
|
||||
"isamchk",
|
||||
@ -13,41 +19,41 @@
|
||||
"Kann Datenbank '%-.64s' nicht erzeugen. (Fehler: %d)",
|
||||
"Kann Datenbank '%-.64s' nicht erzeugen. Datenbank '%-.64s' existiert bereits.",
|
||||
"Kann Datenbank '%-.64s' nicht löschen. Keine Datenbank '%-.64s' vorhanden.",
|
||||
"Fehler beim Löschen der Datenbank. ('%-.64s' kann nicht gelöscht werden, Fehler %d)",
|
||||
"Fehler beim Löschen der Datenbank. (Verzeichnis '%-.64s' kann nicht gelöscht werden, Fehler %d)",
|
||||
"Fehler beim Löschen der Datenbank. ('%-.64s' kann nicht gelöscht werden, Fehlernuumer: %d)",
|
||||
"Fehler beim Löschen der Datenbank. (Verzeichnis '%-.64s' kann nicht gelöscht werden, Fehlernummer: %d)",
|
||||
"Fehler beim Löschen von '%-.64s'. (Fehler: %d)",
|
||||
"Datensatz in der Systemtabelle nicht lesbar.",
|
||||
"Kann Status von '%-.64s' nicht erhalten. (Fehler: %d)",
|
||||
"Kann Arbeitsverzeichnis nicht erhalten. (Fehler: %d)",
|
||||
"File nicht sperrbar. (Fehler: %d)",
|
||||
"Kann Status von '%-.64s' nicht ermitteln. (Fehler: %d)",
|
||||
"Kann Arbeitsverzeichnis nicht ermitteln. (Fehler: %d)",
|
||||
"Datei nicht sperrbar. (Fehler: %d)",
|
||||
"Kann Datei '%-.64s' nicht öffnen. (Fehler: %d)",
|
||||
"Kann Datei '%-.64s' nicht finden. (Fehler: %d)",
|
||||
"Verzeichnis von '%-.64s' nicht lesbar. (Fehler: %d)",
|
||||
"Verzeichnis kann nicht nach '%-.64s' gewechselt werden. (Fehler: %d)",
|
||||
"Kann nicht in das Verzeichnis '%-.64s' wechseln. (Fehler: %d)",
|
||||
"Datensatz hat sich seit dem letzten Zugriff auf Tabelle '%-.64s' geändert.",
|
||||
"Festplatte voll (%-.64s). Warte bis jemand Platz schafft ...",
|
||||
"Kann nicht speichern, doppelter Schlüssel in Tabelle '%-.64s'.",
|
||||
"Fehler beim Schließen von '%-.64s'. (Fehler: %d)",
|
||||
"Fehler beim Lesen der Datei '%-.64s'. (Fehler: %d)",
|
||||
"Fehler beim Umbennenen von '%-.64s' nach '%-.64s'. (Fehler: %d)",
|
||||
"Fehler beim Umbenennen von '%-.64s' nach '%-.64s'. (Fehler: %d)",
|
||||
"Fehler beim Speichern der Datei '%-.64s'. (Fehler: %d)",
|
||||
"'%-.64s' ist für Veränderungen gesperrt.",
|
||||
"Sortieren abgebrochen.",
|
||||
"View '%-.64s' existiert für '%-.64s' nicht.",
|
||||
"Fehler %d. (table handler)",
|
||||
"Diese Option gibt es nicht. (table handler)",
|
||||
"Fehler %d. (Tabellenhandler)",
|
||||
"Diese Option gibt es nicht. (Tabellenhandler)",
|
||||
"Kann Datensatz nicht finden.",
|
||||
"Falsche Information in Datei: '%-.64s'",
|
||||
"Falsche Schlüssel-Datei für Tabelle '%-.64s'. Versuche zu reparieren!",
|
||||
"Alte Schlüssel-Datei für Tabelle '%-.64s'. Repariere!
|
||||
"'%-.64s' ist nur lesbar.",
|
||||
"Kein Speicher (benötigt %d bytes). Server neu starten.",
|
||||
"Kein Speicher zum Sortieren. Server Sortier-Buffer erhöhen.",
|
||||
"Unerwartetes EOF beim Lesen der Datei '%-.64s'. (Fehler: %d)",
|
||||
"Kein Speicher vorhanden (benötigt %d bytes). Server neu starten.",
|
||||
"Kein Speicher zum Sortieren. sort_buffer_size sollte erhöht werden.",
|
||||
"Unerwartetes Ende beim Lesen der Datei '%-.64s'. (Fehler: %d)",
|
||||
"Zu viele Verbindungen.",
|
||||
"Zuwenig Speicher.",
|
||||
"Kann Hostname für diese Adresse nicht erhalten.",
|
||||
"Schlechter handshake.",
|
||||
"Schlechter Handshake.",
|
||||
"Keine Zugriffsberechtigung für Benutzer: '%-.32s@%-.64s' für Datenbank '%-.64s'.",
|
||||
"Keine Zugriffsberechtigung für Benutzer: '%-.32s@%-.64s'. (Verwendetes Passwort: %-.64s)",
|
||||
"Keine Datenbank ausgewählt.",
|
||||
@ -61,16 +67,16 @@
|
||||
"Unbekanntes Tabellenfeld '%-.64s' in %-.64s.",
|
||||
"'%-.64s' ist nicht in GROUP BY.",
|
||||
"Gruppierung nicht möglich bei '%-.64s'.",
|
||||
"Im Statement wurden sowohl sum-Funktionen als auch Spalten verwendet. Nicht möglich.",
|
||||
"Die Verwendung von sum-Funktionen und Spalten ist nicht möglich.",
|
||||
"Spaltenzähler entspricht nicht dem Wertzähler.",
|
||||
"Name des Identifizierers '%-.64s' ist zu lang.",
|
||||
"Name des Bezeichners '%-.64s' ist zu lang.",
|
||||
"Doppelter Spaltenname vorhanden: '%-.64s'",
|
||||
"Doppelter Name für Schlüssel (Key) vorhanden: '%-.64s'",
|
||||
"Doppelter Eintrag '%-.64s' für Schlüssel %d.",
|
||||
"Falsche Spalten-Spezifizierung für Spalte '%-.64s'.",
|
||||
"%-.64s bei '%-.64s' in Zeile %d.",
|
||||
"Leere Abfrage.",
|
||||
"Keine eindeutige(n) Tabelle/Alias: '%-.64s'",
|
||||
"Keine eindeutiger Tabellenname/Alias: '%-.64s'",
|
||||
"Fehlerhafter Vorgabewert (Default-Wert): '%-.64s'",
|
||||
"Mehrfacher Primärschlüssel (Primary Key) definiert.",
|
||||
"Zuviele Schlüssel definiert. Maximal %d Schlüssel erlaubt.",
|
||||
@ -78,37 +84,37 @@
|
||||
"Schlüssel ist zu lang. Die maximale Schlüssellänge beträgt %d.",
|
||||
"In der Tabelle gibt es keine Schlüsselspalte '%-.64s'.",
|
||||
"BLOB-Feld '%-.64s' kann nicht als Schlüssel verwendet werden.",
|
||||
"Feldlänge für Feld '%-.64s' zu groß (max = %d). BLOB-Feld verwenden!",
|
||||
"Feldlänge für Feld '%-.64s' zu groß (max. = %d). BLOB-Feld verwenden!",
|
||||
"Nur ein Auto-Feld möglich, welches als Schlüssel definiert werden muß.",
|
||||
"%-.64s: Warten auf Verbindungen.\n",
|
||||
"%-.64s: Warte auf Verbindungen.\n",
|
||||
"%-.64s: Normal beendet.\n",
|
||||
"%-.64s: Signal %d erhalten. Abbruch!\n",
|
||||
"%-.64s: Shutdown ausgeführt.\n",
|
||||
"%-.64s: Beendigung des Thread %ld veranlaßt. Benutzer: '%-.64s'\n",
|
||||
"%-.64s: Beendigung des Thread %ld veranlasst. Benutzer: '%-.64s'\n",
|
||||
"Kann IP-Socket nicht erstellen.",
|
||||
"Tabelle '%-.64s' hat keinen solchen Index wie in CREATE INDEX verwendet. Index neu anlegen.",
|
||||
"Feld-Separator Argument ist nicht in der Form wie erwartet. Bitte im Manual nachlesen.",
|
||||
"Tabelle '%-.64s' besitzt keinen wie in CREATE INDEX verwendeten Index. Index neu anlegen.",
|
||||
"Feldbegrenzer Argument ist nicht in der Form wie erwartet. Bitte im Manual nachlesen.",
|
||||
"Eine feste Reihenlänge kann für BLOBs nicht verwendet werden. Verwende 'fields terminated by' stattdessen.",
|
||||
"Feld '%-.64s' muß im Datenbank-Directory vorhanden und lesbar für alle sein.",
|
||||
"File '%-.64s' bereits vorhanden.",
|
||||
"Feld '%-.64s' muß im Datenbank-Verzeichnis vorhanden und lesbar für alle sein.",
|
||||
"Datei '%-.64s' bereits vorhanden.",
|
||||
"Datensätze: %ld Gelöscht: %ld Ausgelassen: %ld Warnungen: %ld",
|
||||
"Datensätze: %ld Duplikate: %ld",
|
||||
"Falscher Subteilschlüssel. Der verwendete Schlüsselteil ist entweder kein String oder die verwendete Länge ist länger als der Teilschlüssel.",
|
||||
"Falscher Unterteilschlüssel. Der verwendete Schlüsselteil ist entweder kein String, die verwendete Länge ist länger als der Teilschlüssel oder der Tabellenhandler unterstützt keine Unterteilschlüssel.",
|
||||
"Mit ALTER TABLE können nicht alle Felder auf einmal gelöscht werden. Verwende DROP TABLE stattdessen.",
|
||||
"Kann '%-.64s' nicht löschen (DROP). Existiert das Feld/der Schlüssel?",
|
||||
"Datensätze: %ld Duplikate: %ld Warnungen: %ld",
|
||||
"You can't specify target table '%-.64s' for update in FROM clause",
|
||||
"Die Verwendung der Zieltabelle '%-.64s' ist bei Update in FROM Teil nicht zulässig.",
|
||||
"Unbekannte Thread-ID: %lu",
|
||||
"Nicht Besitzer des Threads %lu.",
|
||||
"Threads %lu. ist einem anderen Besitzer zugeordnet.",
|
||||
"Keine Tabellen in Verwendung.",
|
||||
"Zuviele Strings für Spalte %-.64s und SET.",
|
||||
"Kann keinen eindeutigen Log-Filenamen erstellen %-.64s.(1-999)\n",
|
||||
"Tabelle '%-.64s' mit Lese-Sperre versehen und kann nicht upgedated werden.",
|
||||
"Zuviele Angaben für Spalte %-.64s und SET.",
|
||||
"Kann keinen eindeutigen Dateinamen für die Logdatei ermitteln %-.64s.(1-999)\n",
|
||||
"Tabelle '%-.64s' mit Lese-Sperre versehen und kann nicht aktualisiert werden.",
|
||||
"Tabelle '%-.64s' wurde nicht mittels LOCK TABLES gesperrt.",
|
||||
"BLOB-Feld '%-.64s' kann keinen Vorgabewert (Default-Value) besitzen.",
|
||||
"Unerlaubter Datenbankname '%-.64s'.",
|
||||
"Unerlaubter Tabellenname '%-.64s'.",
|
||||
"Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange daueren. Bitte WHERE überprüfen und SET OPTION SQL_BIG_SELECTS=1 verwenden, sofern SELECT ok ist.",
|
||||
"Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange daueren. Bitte WHERE überprüfen oder gegebenenfalls SET OPTION SQL_BIG_SELECTS=1 verwenden.",
|
||||
"Unbekannter Fehler.",
|
||||
"Unbekannte Procedure %-.64s.",
|
||||
"Falsche Parameterzahl für Procedure %-.64s.",
|
||||
@ -135,51 +141,51 @@
|
||||
"Funktion '%-.64s' ist nicht definiert.",
|
||||
"Host blockiert wegen zu vieler Verbindungsfehler. Aufheben der Blockierung mit 'mysqladmin flush-hosts'.",
|
||||
"Host hat keine Berechtigung, eine Verbindung zu diesem MySQL Server herzustellen.",
|
||||
"Sie benutzen MySQL als anonymer User; diese User dürfen keine Passwörter ändern.",
|
||||
"Sie müssen autorisiert sein zum UPDATE von Tabellen in der mysql Datenbank, um für andere Benutzer Passwörter ändern zu können.",
|
||||
"Kann keinen passenden Datensatz in der User-Tabelle finden.",
|
||||
"Sie benutzen MySQL als anonymer Benutzer und dürfen daher keine Passwörter ändern.",
|
||||
"Sie müssen autorisiert sein zum Aktualisieren von Tabellen in der mysql Datenbank, um für andere Benutzer Passwörter ändern zu können.",
|
||||
"Kann keinen passenden Datensatz in der Benutzer-Tabelle finden.",
|
||||
"Datensätze gefunden: %ld Geändert: %ld Warnungen: %ld",
|
||||
"Kann keinen neuen Thread erzeugen (errno %d). Sollte nicht die Speichergrenze erreicht sein, bitte im Manual nach vorhanden OS-Abhängigen Fehlern nachschauen.",
|
||||
"Kann keinen neuen Thread erzeugen (Fehler: %d). Sollte die Speichergrenze nicht erreicht sein, bitte in der Dokumentation nach evtl. Betriebssystem abhängigen Fehlern nachlesen.",
|
||||
"Spaltenzahl stimmt nicht mit der Anzahl der Werte überein in Reihe%ld",
|
||||
"Kann Tabelle'%-.64s' nicht wieder öffnen",
|
||||
"Unerlaubte Verwendung eines NULL-Wertes",
|
||||
"Fehler '%-.64s' von regexp",
|
||||
"Das Vermischen von GROUP Spalten (MIN(),MAX(),COUNT()...) mit Nicht-GROUP Spalten ist nicht erlaubt, sofern keine GROUP BY Klausel vorhanden ist.",
|
||||
"Keine solche Berechtigung für User '%-.32s' auf Host '%-.64s'",
|
||||
"%-.16s Kommando abgelehnt für User: '%-.32s@%-.64s' für Tabelle '%-.64s'",
|
||||
"%-.16s Kommando abgelehnt für User: '%-.32s@%-.64s' in Spalte '%-.64s' in Tabelle '%-.64s'",
|
||||
"Unzulässiges GRANT/REVOKE Kommando. Weiteres zum Thema Berechtigungen im Manual.",
|
||||
"%-.16s Befehl nicht erlaubt für User: '%-.32s@%-.64s' für Tabelle '%-.64s'",
|
||||
"%-.16s Befehl nicht erlaubt für User: '%-.32s@%-.64s' in Spalte '%-.64s' in Tabelle '%-.64s'",
|
||||
"Unzulässiger GRANT/REVOKE Befehl. Weiteres zum Thema Berechtigungen im Manual.",
|
||||
"Das Host oder User Argument für GRANT ist zu lang",
|
||||
"Tabelle '%-.64s.%-.64s' existiert nicht",
|
||||
"Keine solche Berechtigung für User '%-.32s' auf Host '%-.64s' an Tabelle '%-.64s'",
|
||||
"Das used Kommando ist mit dieser MySQL Version nicht erlaubt",
|
||||
"Der used Befehl ist mit dieser MySQL Version nicht erlaubt",
|
||||
"Fehler in der Syntax",
|
||||
"Verzögerter Einfüge-Thread konnte den angeforderten Lock für Tabelle %-.64s nicht bekommen",
|
||||
"Verzögerter Einfüge-Thread konnte den angeforderten Lock für Tabelle %-.64s nicht erhalten",
|
||||
"Zu viele Delayed Threads in Verwendung",
|
||||
"Abbruch der Verbindung %ld zur Datenbank: '%-.64s' User: '%-.64s' (%-.64s)",
|
||||
"Empfangenes Paket ist größer als 'max_allowed_packet'",
|
||||
"Lese-Fehler bei einer Kommunikations-Pipe",
|
||||
"Fehler von fcntl()",
|
||||
"Empfangenes Paket ist nicht in Reihenfolge",
|
||||
"Communikation-Packet läßt sich nicht entpacken",
|
||||
"Fehler beim Lesen eines Communication-Packets"
|
||||
"Timeout beim Lesen eines Communication-Packets",
|
||||
"Fehler beim Schreiben eines Communication-Packets",
|
||||
"Timeout beim Schreiben eines Communication-Packets",
|
||||
"Ergebnisstring ist länger als max_allowed_packet",
|
||||
"Kommunikationspaket läßt sich nicht entpacken",
|
||||
"Fehler beim Lesen eines Kommunikationspakets"
|
||||
"Zeitüberschreitung beim Lesen eines Kommunikationspakets.",
|
||||
"Fehler beim Schreiben eines Kommunikationspakets.",
|
||||
"Zeitüberschreitung beim Schreiben eines Kommunikationspakets.",
|
||||
"Ergebnis ist länger als max_allowed_packet",
|
||||
"Der verwendete Tabellentyp unterstützt keine BLOB/TEXT Spalten",
|
||||
"Der verwendete Tabellentyp unterstützt keine AUTO_INCREMENT Spalte",
|
||||
"INSERT DELAYED kann nicht auf Tabelle '%-.64s' angewendet werden, da diese mit LOCK TABLES gesperrt ist",
|
||||
"Falscher Spaltenname '%-.100s'",
|
||||
"Der verwendete Tabellen-Handler kann die Spalte '%-.64s' nicht indizieren",
|
||||
"Alle Tabelle in der MERGE-Tabelle sind nicht gleich definiert",
|
||||
"Alle Tabellen in der MERGE-Tabelle sind nicht gleich definiert",
|
||||
"Schreiben in Tabelle '%-.64s' nicht möglich wegen eines Unique Constraint",
|
||||
"BLOB Spalte '%-.64s' wird in der Key-Definition ohne Längenangabe verwendet",
|
||||
"Alle Teile eines PRIMARY KEY müssen als NOT NULL definiert sein; Wenn NULL benötigt wird sollte ein UNIQUE Key verwendet werden",
|
||||
"Ergebnis besteht aus mehr als einer Reihe",
|
||||
"Dieser Tabellentyp verlangt nach einem PRIMARY KEY",
|
||||
"Diese MySQL-Version ist nicht mit RAID-Unterstützung kompiliert",
|
||||
"Unter Verwendung des Sicheren Updatemodes wurde versucht eine Tabelle zu updaten ohne eine KEY-Spalte in der WHERE-Klausel",
|
||||
"Unter Verwendung des sicheren Aktualisierungsmodus wurde versucht eine Tabelle zu aktualisieren ohne eine KEY-Spalte in der WHERE-Klausel",
|
||||
"Schlüssel '%-.64s' existiert nicht in der Tabelle '%-.64s'",
|
||||
"Kann Tabelle nicht öffnen",
|
||||
"Der Tabellen-Handler für diese Tabelle unterstützt kein %s",
|
||||
@ -191,65 +197,66 @@
|
||||
"Verbindungsabbruch %ld zu db: '%-.64s' user: '%-.32s' host: `%-.64s' (%-.64s)",
|
||||
"Der Tabellenhandler für die Tabelle unterstützt kein Binary Tabellendump",
|
||||
"Binlog wurde beendet wärend FLUSH MASTER",
|
||||
"Neubau des Index der gedumpten Tabelle '%-.64s' fehlgeschlagen",
|
||||
"Neuerstellung des Index der gedumpten Tabelle '%-.64s' fehlgeschlagen",
|
||||
"Fehler vom Master: '%-.64s'",
|
||||
"Netzfehler beim Lesen vom Master",
|
||||
"Netzfehler beim Schreiben zum Master",
|
||||
"Kann keinen FULLTEXT-Index finden der der Spaltenliste entspricht",
|
||||
"Kann keinen FULLTEXT-Index finden, der der Spaltenliste entspricht",
|
||||
"Kann das aktuelle Kommando wegen aktiver Tabellensperre oder aktiver Transaktion nicht ausführen",
|
||||
"Unbekannte System-Variabel '%-.64s'",
|
||||
"Unbekannte Systemvariable '%-.64s'",
|
||||
"Tabelle '%-.64s' ist als defekt makiert und sollte repariert werden",
|
||||
"Tabelle '%-.64s' ist als defekt makiert und der letzte (automatische) Reparaturversuch schlug fehl.",
|
||||
"Warnung: Das Rollback konnte bei einigen Tabellen, die nicht mittels Transaktionen geändert wurden, nicht ausgeführt werden.",
|
||||
"Multi-Statement Transaktionen benötigen mehr als 'max_binlog_cache_size' Bytes An Speicher. Diese mysqld-Variabel vergrössern und nochmal versuchen.',
|
||||
"Multi-Statement Transaktionen benötigen mehr als 'max_binlog_cache_size' Bytes An Speicher. Diese mysqld-Variable vergrössern und erneut versuchen.',
|
||||
"Diese Operation kann nicht bei einem aktiven Slave durchgeführt werden. Das Kommand SLAVE STOP muss zuerst ausgeführt werden.",
|
||||
"Diese Operationbenötigt einen aktiven Slave. Slave konfigurieren und mittels SLAVE START aktivieren.",
|
||||
"Diese Operation benötigt einen aktiven Slave. Slave konfigurieren und mittels SLAVE START aktivieren.",
|
||||
"Der Server ist nicht als Slave konfigiriert. Im Konfigurations-File oder mittel CHANGE MASTER TO beheben.",
|
||||
"Konnte Master-Info-Struktur nicht initialisieren; Berechtigungen von master.info prüfen.",
|
||||
"Konnte keinen Slave-Thread starten. System-Resourcen überprüfen.",
|
||||
"Benutzer %-.64s hat mehr als 'max_user_connections' aktive Verbindungen",
|
||||
"Bei der Verwendung mit SET dürfen nur Constante Ausdrücke verwendet werden",
|
||||
"Lock wait timeout exceeded",
|
||||
"The total number of locks exceeds the lock table size",
|
||||
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
|
||||
"DROP DATABASE not allowed while thread is holding global read lock",
|
||||
"CREATE DATABASE not allowed while thread is holding global read lock",
|
||||
"Wrong arguments to %s",
|
||||
"%-.32s@%-.64s is not allowed to create new users",
|
||||
"Incorrect table definition; All MERGE tables must be in the same database",
|
||||
"Deadlock found when trying to get lock; Try restarting transaction",
|
||||
"The used table type doesn't support FULLTEXT indexes",
|
||||
"Cannot add foreign key constraint",
|
||||
"Cannot add a child row: a foreign key constraint fails",
|
||||
"Cannot delete a parent row: a foreign key constraint fails",
|
||||
"Error connecting to master: %-.128s",
|
||||
"Error running query on master: %-.128s",
|
||||
"Error when executing command %s: %-.128s",
|
||||
"Wrong usage of %s and %s",
|
||||
"The used SELECT statements have a different number of columns",
|
||||
"Can't execute the query because you have a conflicting read lock",
|
||||
"Mixing of transactional and non-transactional tables is disabled",
|
||||
"Option '%s' used twice in statement",
|
||||
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
|
||||
"Access denied. You need the %-.128s privilege for this operation",
|
||||
"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
|
||||
"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
|
||||
"Variable '%-.64s' doesn't have a default value",
|
||||
"Variable '%-.64s' can't be set to the value of '%-.64s'",
|
||||
"Wrong argument type to variable '%-.64s'",
|
||||
"Variable '%-.64s' can only be set, not read",
|
||||
"Wrong usage/placement of '%s'",
|
||||
"This version of MySQL doesn't yet support '%s'",
|
||||
"Got fatal error %d: '%-.128s' from master when reading data from binary log",
|
||||
"Wrong foreign key definition for '%-.64s': %s",
|
||||
"Key reference and table reference doesn't match",
|
||||
"Cardinality error (more/less than %d columns)",
|
||||
"Subselect return more than 1 record",
|
||||
"Unknown prepared statement handler (%ld) given to %s",
|
||||
"Help database is corrupt or does not exist",
|
||||
"Cyclic reference on subqueries",
|
||||
"Converting column '%s' from %s to %s",
|
||||
"Reference '%-.64s' not supported (%s)",
|
||||
"Every derived table must have it's own alias"
|
||||
"Select %u was reduced during optimisation",
|
||||
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
|
||||
"Bei der Verwendung mit SET dürfen nur konstante Ausdrücke verwendet werden",
|
||||
"Beim Warten auf einen LOCK wurde die zulässige Wartezeit überschritten.",
|
||||
"Die Gesamtanzahl der LOCKS überschreitet die Grösse der Locktabelle.",
|
||||
"Während einer READ UNCOMMITED Transaktion kann keine Update LOCK angefordert werden.",
|
||||
"Solange ein globaler Read LOCK gesetzt ist, ist DROP DATABASE nicht zulässig.",
|
||||
"Solange ein globaler Read LOCK gesetzt ist, ist CREATE DATABASE nicht zulässig.",
|
||||
"Falsche Argumente für %s",
|
||||
"%-.32s@%-.64s is nicht berechtigt neue Benutzer hinzuzufügen.",
|
||||
"Falsche Tabellendefinition: Sämtliche MERGE-Tabellen müssen in derselben Datenbank sein.",
|
||||
"Beim Versuch einen Lock anzufordern ist ein Deadlock aufgetreten. Es wird versucht die Transaktion erneut zu starten.",
|
||||
"Der verwendete Tabellentyp unterstützt keinen FULLTEXT-Index.",
|
||||
"Foreign_Key Beschränkung konnte nicht hinzugefügt werden."
|
||||
"Hinzufügen eines Kind-Datensatzes schlug aufgrund einer Foreign-Key Beschränkung fehl.",
|
||||
"Löschen eines Eltern-Datensatzes schlug aufgrund einer Foreign-Key Beschränkung fehl.",
|
||||
"Datensatz kann aufgrund einer Foreign-Key Beschränkung nicht gelöscht werden.",
|
||||
"Fehler bei der Verbindung zum Master: %-.128s",
|
||||
"Beim Ausführen einer Abfrage auf dem Master trat ein Fehler auf: %-.128s.",
|
||||
"Fehler beim Ausführen des Befehls %s: %-.128s.",
|
||||
"Falsche Verwendung von %s und %s.",
|
||||
"Die verwendeten SELECTs liefern eine unterschiedliche Anzahl von Spalten zurück.",
|
||||
"Augrund eines READ LOCK Konflikts kann die Abfrage nicht ausgeführt werden.",
|
||||
"Die Verwendung von transaktions- und nicht transaktionsaktionsunterstützenden Tabellen ist deaktiviert.",
|
||||
"Option '%s' wird im Befehl zweimal verwendet.",
|
||||
"Benutzer '%-.64s' hat Limit '%s' überschritten. (Momentaner Wert: %ld)",
|
||||
"Befehl nicht zulässig. Hierfür wird die Berechtigung %-.128s benötigt.",
|
||||
"Variable '%-.64s' ist eine lokale Variable und kann nicht mit SET GLOBAL verändert werden.",
|
||||
"Variable '%-.64s' ist eine globale Variable und muss mit SET GLOBAL verändert werden.",
|
||||
"Variable '%-.64s' besitzt keinen vorgegebenen Wert.",
|
||||
"Der Variablen '%-.64s' kann nicht der Wert '%-.64s' zugewiesen werden.",
|
||||
"Falscher Typ für Variable '%-.64s'",
|
||||
"Variable '%-.64s' kann nur verändert, nicht aber gelesen werden.",
|
||||
"Falsche Verwendung oder Platzierung von '%s'",
|
||||
"Diese MySQL-Version unterstützt momentan nicht '%s'.",
|
||||
"Schwerer Fehler %d: '%-.128s vom Master beim Lesen des Binary Logs.",
|
||||
"Falsche Foreign-Key Definition für '%-64s': %s",
|
||||
"Schlüssel- und Tabellenreferenz passen nicht zueinander.",
|
||||
"Kardinalitäts-Fehler (mehr/oder weniger als %d Spalten).",
|
||||
"Unterabfrage lieferte mehr als einen Datensatz zurück.",
|
||||
"Unbekannter prepared statement handler (%ld) für %s angegeben.",
|
||||
"Die Hilfedatenbank ist beschädigt oder existiert nicht.",
|
||||
"Zyklische Referenz in den Unterabfragen.",
|
||||
"Spalte '%s' wird von %s nach %s umgewandelt",
|
||||
"Referenz '%-.64s' wird nicht unterstützt (%s)",
|
||||
"Für jede abgeleitete Tabelle muss ein eigener Alias angegeben werden.",
|
||||
"Select %u wurde während der Optimierung reduziert.",
|
||||
"Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde kann nicht in %-.32s verwendet werden."
|
||||
|
164
sql/sql_acl.cc
164
sql/sql_acl.cc
@ -388,7 +388,7 @@ static ulong get_access(TABLE *form, uint fieldnr)
|
||||
{
|
||||
ulong access_bits=0,bit;
|
||||
char buff[2];
|
||||
String res(buff,sizeof(buff),default_charset_info);
|
||||
String res(buff,sizeof(buff),my_charset_latin1);
|
||||
Field **pos;
|
||||
|
||||
for (pos=form->field+fieldnr, bit=1;
|
||||
@ -397,7 +397,7 @@ static ulong get_access(TABLE *form, uint fieldnr)
|
||||
pos++ , bit<<=1)
|
||||
{
|
||||
(*pos)->val_str(&res,&res);
|
||||
if (my_toupper(system_charset_info, res[0]) == 'Y')
|
||||
if (my_toupper(my_charset_latin1, res[0]) == 'Y')
|
||||
access_bits|= bit;
|
||||
}
|
||||
return access_bits;
|
||||
@ -697,7 +697,7 @@ static void acl_update_user(const char *user, const char *host,
|
||||
{
|
||||
if (!acl_user->host.hostname && !host[0] ||
|
||||
acl_user->host.hostname &&
|
||||
!my_strcasecmp(system_charset_info, host, acl_user->host.hostname))
|
||||
!my_strcasecmp(my_charset_latin1, host, acl_user->host.hostname))
|
||||
{
|
||||
acl_user->access=privileges;
|
||||
if (mqh->bits & 1)
|
||||
@ -792,7 +792,7 @@ static void acl_update_db(const char *user, const char *host, const char *db,
|
||||
{
|
||||
if (!acl_db->host.hostname && !host[0] ||
|
||||
acl_db->host.hostname &&
|
||||
!my_strcasecmp(system_charset_info, host, acl_db->host.hostname))
|
||||
!my_strcasecmp(my_charset_latin1, host, acl_db->host.hostname))
|
||||
{
|
||||
if (!acl_db->db && !db[0] ||
|
||||
acl_db->db && !strcmp(db,acl_db->db))
|
||||
@ -856,7 +856,7 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
|
||||
end=strmov((tmp_db=strmov(key+sizeof(struct in_addr),user)+1),db);
|
||||
if (lower_case_table_names)
|
||||
{
|
||||
my_casedn_str(system_charset_info, tmp_db);
|
||||
my_casedn_str(my_charset_latin1, tmp_db);
|
||||
db=tmp_db;
|
||||
}
|
||||
key_length=(uint) (end-key);
|
||||
@ -974,7 +974,7 @@ static void init_check_host(void)
|
||||
DBUG_ENTER("init_check_host");
|
||||
VOID(my_init_dynamic_array(&acl_wild_hosts,sizeof(struct acl_host_and_ip),
|
||||
acl_users.elements,1));
|
||||
VOID(hash_init(&acl_check_hosts,system_charset_info,acl_users.elements,0,0,
|
||||
VOID(hash_init(&acl_check_hosts,my_charset_latin1,acl_users.elements,0,0,
|
||||
(hash_get_key) check_get_key,0,HASH_CASE_INSENSITIVE));
|
||||
if (!allow_all_hosts)
|
||||
{
|
||||
@ -990,7 +990,7 @@ static void init_check_host(void)
|
||||
{ // Check if host already exists
|
||||
acl_host_and_ip *acl=dynamic_element(&acl_wild_hosts,j,
|
||||
acl_host_and_ip *);
|
||||
if (!my_strcasecmp(system_charset_info,
|
||||
if (!my_strcasecmp(my_charset_latin1,
|
||||
acl_user->host.hostname, acl->hostname))
|
||||
break; // already stored
|
||||
}
|
||||
@ -1069,7 +1069,7 @@ bool check_change_password(THD *thd, const char *host, const char *user)
|
||||
}
|
||||
if (!thd->slave_thread &&
|
||||
(strcmp(thd->user,user) ||
|
||||
my_strcasecmp(system_charset_info, host, thd->host_or_ip)))
|
||||
my_strcasecmp(my_charset_latin1, host, thd->host_or_ip)))
|
||||
{
|
||||
if (check_access(thd, UPDATE_ACL, "mysql",0,1))
|
||||
return(1);
|
||||
@ -1233,7 +1233,7 @@ static bool compare_hostname(const acl_host_and_ip *host, const char *hostname,
|
||||
return (tmp & host->ip_mask) == host->ip;
|
||||
}
|
||||
return (!host->hostname ||
|
||||
(hostname && !wild_case_compare(system_charset_info,
|
||||
(hostname && !wild_case_compare(my_charset_latin1,
|
||||
hostname,host->hostname)) ||
|
||||
(ip && !wild_compare(ip,host->hostname)));
|
||||
}
|
||||
@ -1257,8 +1257,8 @@ static bool update_user_table(THD *thd, const char *host, const char *user,
|
||||
tables.db=(char*) "mysql";
|
||||
if (!(table=open_ltable(thd,&tables,TL_WRITE)))
|
||||
DBUG_RETURN(1); /* purecov: deadcode */
|
||||
table->field[0]->store(host,(uint) strlen(host), system_charset_info);
|
||||
table->field[1]->store(user,(uint) strlen(user), system_charset_info);
|
||||
table->field[0]->store(host,(uint) strlen(host), my_charset_latin1);
|
||||
table->field[1]->store(user,(uint) strlen(user), my_charset_latin1);
|
||||
|
||||
if (table->file->index_read_idx(table->record[0],0,
|
||||
(byte*) table->field[0]->ptr,0,
|
||||
@ -1268,7 +1268,7 @@ static bool update_user_table(THD *thd, const char *host, const char *user,
|
||||
DBUG_RETURN(1); /* purecov: deadcode */
|
||||
}
|
||||
store_record(table,1);
|
||||
table->field[2]->store(new_password,(uint) strlen(new_password), system_charset_info);
|
||||
table->field[2]->store(new_password,(uint) strlen(new_password), my_charset_latin1);
|
||||
if ((error=table->file->update_row(table->record[1],table->record[0])))
|
||||
{
|
||||
table->file->print_error(error,MYF(0)); /* purecov: deadcode */
|
||||
@ -1335,8 +1335,8 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
|
||||
password=combo.password.str;
|
||||
}
|
||||
|
||||
table->field[0]->store(combo.host.str,combo.host.length, system_charset_info);
|
||||
table->field[1]->store(combo.user.str,combo.user.length, system_charset_info);
|
||||
table->field[0]->store(combo.host.str,combo.host.length, my_charset_latin1);
|
||||
table->field[1]->store(combo.user.str,combo.user.length, my_charset_latin1);
|
||||
table->file->index_init(0);
|
||||
if (table->file->index_read(table->record[0],
|
||||
(byte*) table->field[0]->ptr,0,
|
||||
@ -1357,16 +1357,16 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
|
||||
}
|
||||
old_row_exists = 0;
|
||||
restore_record(table,2); // cp empty row from record[2]
|
||||
table->field[0]->store(combo.host.str,combo.host.length, system_charset_info);
|
||||
table->field[1]->store(combo.user.str,combo.user.length, system_charset_info);
|
||||
table->field[2]->store(password,(uint) strlen(password), system_charset_info);
|
||||
table->field[0]->store(combo.host.str,combo.host.length, my_charset_latin1);
|
||||
table->field[1]->store(combo.user.str,combo.user.length, my_charset_latin1);
|
||||
table->field[2]->store(password,(uint) strlen(password), my_charset_latin1);
|
||||
}
|
||||
else
|
||||
{
|
||||
old_row_exists = 1;
|
||||
store_record(table,1); // Save copy for update
|
||||
if (combo.password.str) // If password given
|
||||
table->field[2]->store(password,(uint) strlen(password), system_charset_info);
|
||||
table->field[2]->store(password,(uint) strlen(password), my_charset_latin1);
|
||||
}
|
||||
|
||||
/* Update table columns with new privileges */
|
||||
@ -1379,7 +1379,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
|
||||
tmp_field++, priv <<= 1)
|
||||
{
|
||||
if (priv & rights) // set requested privileges
|
||||
(*tmp_field)->store(&what, 1, system_charset_info);
|
||||
(*tmp_field)->store(&what, 1, my_charset_latin1);
|
||||
}
|
||||
rights=get_access(table,3);
|
||||
DBUG_PRINT("info",("table->fields: %d",table->fields));
|
||||
@ -1388,39 +1388,39 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
|
||||
/* We write down SSL related ACL stuff */
|
||||
switch (thd->lex.ssl_type) {
|
||||
case SSL_TYPE_ANY:
|
||||
table->field[24]->store("ANY",3, system_charset_info);
|
||||
table->field[25]->store("", 0, system_charset_info);
|
||||
table->field[26]->store("", 0, system_charset_info);
|
||||
table->field[27]->store("", 0, system_charset_info);
|
||||
table->field[24]->store("ANY",3, my_charset_latin1);
|
||||
table->field[25]->store("", 0, my_charset_latin1);
|
||||
table->field[26]->store("", 0, my_charset_latin1);
|
||||
table->field[27]->store("", 0, my_charset_latin1);
|
||||
break;
|
||||
case SSL_TYPE_X509:
|
||||
table->field[24]->store("X509",4, system_charset_info);
|
||||
table->field[25]->store("", 0, system_charset_info);
|
||||
table->field[26]->store("", 0, system_charset_info);
|
||||
table->field[27]->store("", 0, system_charset_info);
|
||||
table->field[24]->store("X509",4, my_charset_latin1);
|
||||
table->field[25]->store("", 0, my_charset_latin1);
|
||||
table->field[26]->store("", 0, my_charset_latin1);
|
||||
table->field[27]->store("", 0, my_charset_latin1);
|
||||
break;
|
||||
case SSL_TYPE_SPECIFIED:
|
||||
table->field[24]->store("SPECIFIED",9, system_charset_info);
|
||||
table->field[25]->store("", 0, system_charset_info);
|
||||
table->field[26]->store("", 0, system_charset_info);
|
||||
table->field[27]->store("", 0, system_charset_info);
|
||||
table->field[24]->store("SPECIFIED",9, my_charset_latin1);
|
||||
table->field[25]->store("", 0, my_charset_latin1);
|
||||
table->field[26]->store("", 0, my_charset_latin1);
|
||||
table->field[27]->store("", 0, my_charset_latin1);
|
||||
if (thd->lex.ssl_cipher)
|
||||
table->field[25]->store(thd->lex.ssl_cipher,
|
||||
strlen(thd->lex.ssl_cipher), system_charset_info);
|
||||
strlen(thd->lex.ssl_cipher), my_charset_latin1);
|
||||
if (thd->lex.x509_issuer)
|
||||
table->field[26]->store(thd->lex.x509_issuer,
|
||||
strlen(thd->lex.x509_issuer), system_charset_info);
|
||||
strlen(thd->lex.x509_issuer), my_charset_latin1);
|
||||
if (thd->lex.x509_subject)
|
||||
table->field[27]->store(thd->lex.x509_subject,
|
||||
strlen(thd->lex.x509_subject), system_charset_info);
|
||||
strlen(thd->lex.x509_subject), my_charset_latin1);
|
||||
break;
|
||||
case SSL_TYPE_NOT_SPECIFIED:
|
||||
break;
|
||||
case SSL_TYPE_NONE:
|
||||
table->field[24]->store("", 0, system_charset_info);
|
||||
table->field[25]->store("", 0, system_charset_info);
|
||||
table->field[26]->store("", 0, system_charset_info);
|
||||
table->field[27]->store("", 0, system_charset_info);
|
||||
table->field[24]->store("", 0, my_charset_latin1);
|
||||
table->field[25]->store("", 0, my_charset_latin1);
|
||||
table->field[26]->store("", 0, my_charset_latin1);
|
||||
table->field[27]->store("", 0, my_charset_latin1);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1509,9 +1509,9 @@ static int replace_db_table(TABLE *table, const char *db,
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
table->field[0]->store(combo.host.str,combo.host.length, system_charset_info);
|
||||
table->field[1]->store(db,(uint) strlen(db), system_charset_info);
|
||||
table->field[2]->store(combo.user.str,combo.user.length, system_charset_info);
|
||||
table->field[0]->store(combo.host.str,combo.host.length, my_charset_latin1);
|
||||
table->field[1]->store(db,(uint) strlen(db), my_charset_latin1);
|
||||
table->field[2]->store(combo.user.str,combo.user.length, my_charset_latin1);
|
||||
table->file->index_init(0);
|
||||
if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr,0,
|
||||
HA_READ_KEY_EXACT))
|
||||
@ -1524,9 +1524,9 @@ static int replace_db_table(TABLE *table, const char *db,
|
||||
}
|
||||
old_row_exists = 0;
|
||||
restore_record(table,2); // cp empty row from record[2]
|
||||
table->field[0]->store(combo.host.str,combo.host.length, system_charset_info);
|
||||
table->field[1]->store(db,(uint) strlen(db), system_charset_info);
|
||||
table->field[2]->store(combo.user.str,combo.user.length, system_charset_info);
|
||||
table->field[0]->store(combo.host.str,combo.host.length, my_charset_latin1);
|
||||
table->field[1]->store(db,(uint) strlen(db), my_charset_latin1);
|
||||
table->field[2]->store(combo.user.str,combo.user.length, my_charset_latin1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1538,7 +1538,7 @@ static int replace_db_table(TABLE *table, const char *db,
|
||||
for (i= 3, priv= 1; i < table->fields; i++, priv <<= 1)
|
||||
{
|
||||
if (priv & store_rights) // do it if priv is chosen
|
||||
table->field [i]->store(&what,1, system_charset_info);// set requested privileges
|
||||
table->field [i]->store(&what,1, my_charset_latin1);// set requested privileges
|
||||
}
|
||||
rights=get_access(table,3);
|
||||
rights=fix_rights_for_db(rights);
|
||||
@ -1619,13 +1619,13 @@ public:
|
||||
tname= strdup_root(&memex,t);
|
||||
if (lower_case_table_names)
|
||||
{
|
||||
my_casedn_str(system_charset_info, db);
|
||||
my_casedn_str(system_charset_info, tname);
|
||||
my_casedn_str(my_charset_latin1, db);
|
||||
my_casedn_str(my_charset_latin1, tname);
|
||||
}
|
||||
key_length =(uint) strlen(d)+(uint) strlen(u)+(uint) strlen(t)+3;
|
||||
hash_key = (char*) alloc_root(&memex,key_length);
|
||||
strmov(strmov(strmov(hash_key,user)+1,db)+1,tname);
|
||||
(void) hash_init(&hash_columns,system_charset_info,
|
||||
(void) hash_init(&hash_columns,my_charset_latin1,
|
||||
0,0,0, (hash_get_key) get_key_column,0,
|
||||
HASH_CASE_INSENSITIVE);
|
||||
}
|
||||
@ -1648,8 +1648,8 @@ public:
|
||||
}
|
||||
if (lower_case_table_names)
|
||||
{
|
||||
my_casedn_str(system_charset_info, db);
|
||||
my_casedn_str(system_charset_info, tname);
|
||||
my_casedn_str(my_charset_latin1, db);
|
||||
my_casedn_str(my_charset_latin1, tname);
|
||||
}
|
||||
key_length = ((uint) strlen(db) + (uint) strlen(user) +
|
||||
(uint) strlen(tname) + 3);
|
||||
@ -1660,22 +1660,22 @@ public:
|
||||
privs = fix_rights_for_table(privs);
|
||||
cols = fix_rights_for_column(cols);
|
||||
|
||||
(void) hash_init(&hash_columns,system_charset_info,
|
||||
(void) hash_init(&hash_columns,my_charset_latin1,
|
||||
0,0,0, (hash_get_key) get_key_column,0,
|
||||
HASH_CASE_INSENSITIVE);
|
||||
if (cols)
|
||||
{
|
||||
int key_len;
|
||||
col_privs->field[0]->store(host,(uint) strlen(host), system_charset_info);
|
||||
col_privs->field[1]->store(db,(uint) strlen(db), system_charset_info);
|
||||
col_privs->field[2]->store(user,(uint) strlen(user), system_charset_info);
|
||||
col_privs->field[3]->store(tname,(uint) strlen(tname), system_charset_info);
|
||||
col_privs->field[0]->store(host,(uint) strlen(host), my_charset_latin1);
|
||||
col_privs->field[1]->store(db,(uint) strlen(db), my_charset_latin1);
|
||||
col_privs->field[2]->store(user,(uint) strlen(user), my_charset_latin1);
|
||||
col_privs->field[3]->store(tname,(uint) strlen(tname), my_charset_latin1);
|
||||
key_len=(col_privs->field[0]->pack_length()+
|
||||
col_privs->field[1]->pack_length()+
|
||||
col_privs->field[2]->pack_length()+
|
||||
col_privs->field[3]->pack_length());
|
||||
key_copy(key,col_privs,0,key_len);
|
||||
col_privs->field[4]->store("",0, system_charset_info);
|
||||
col_privs->field[4]->store("",0, my_charset_latin1);
|
||||
col_privs->file->index_init(0);
|
||||
if (col_privs->file->index_read(col_privs->record[0],
|
||||
(byte*) col_privs->field[0]->ptr,
|
||||
@ -1741,15 +1741,15 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
|
||||
if (exact)
|
||||
{
|
||||
if ((host &&
|
||||
!my_strcasecmp(system_charset_info, host, grant_table->host)) ||
|
||||
!my_strcasecmp(my_charset_latin1, host, grant_table->host)) ||
|
||||
(ip && !strcmp(ip,grant_table->host)))
|
||||
return grant_table;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((host && !wild_case_compare(system_charset_info,
|
||||
if ((host && !wild_case_compare(my_charset_latin1,
|
||||
host,grant_table->host)) ||
|
||||
(ip && !wild_case_compare(system_charset_info,
|
||||
(ip && !wild_case_compare(my_charset_latin1,
|
||||
ip,grant_table->host)))
|
||||
found=grant_table; // Host ok
|
||||
}
|
||||
@ -1777,10 +1777,10 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
||||
byte key[MAX_KEY_LENGTH];
|
||||
DBUG_ENTER("replace_column_table");
|
||||
|
||||
table->field[0]->store(combo.host.str,combo.host.length, system_charset_info);
|
||||
table->field[1]->store(db,(uint) strlen(db), system_charset_info);
|
||||
table->field[2]->store(combo.user.str,combo.user.length, system_charset_info);
|
||||
table->field[3]->store(table_name,(uint) strlen(table_name), system_charset_info);
|
||||
table->field[0]->store(combo.host.str,combo.host.length, my_charset_latin1);
|
||||
table->field[1]->store(db,(uint) strlen(db), my_charset_latin1);
|
||||
table->field[2]->store(combo.user.str,combo.user.length, my_charset_latin1);
|
||||
table->field[3]->store(table_name,(uint) strlen(table_name), my_charset_latin1);
|
||||
key_length=(table->field[0]->pack_length()+ table->field[1]->pack_length()+
|
||||
table->field[2]->pack_length()+ table->field[3]->pack_length());
|
||||
key_copy(key,table,0,key_length);
|
||||
@ -1797,7 +1797,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
||||
ulong privileges = xx->rights;
|
||||
bool old_row_exists=0;
|
||||
key_restore(table,key,0,key_length);
|
||||
table->field[4]->store(xx->column.ptr(),xx->column.length(),system_charset_info);
|
||||
table->field[4]->store(xx->column.ptr(),xx->column.length(),my_charset_latin1);
|
||||
|
||||
if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr,
|
||||
0, HA_READ_KEY_EXACT))
|
||||
@ -1813,7 +1813,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
||||
old_row_exists = 0;
|
||||
restore_record(table,2); // Get empty record
|
||||
key_restore(table,key,0,key_length);
|
||||
table->field[4]->store(xx->column.ptr(),xx->column.length(), system_charset_info);
|
||||
table->field[4]->store(xx->column.ptr(),xx->column.length(), my_charset_latin1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1885,7 +1885,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
||||
{
|
||||
GRANT_COLUMN *grant_column = NULL;
|
||||
char colum_name_buf[HOSTNAME_LENGTH+1];
|
||||
String column_name(colum_name_buf,sizeof(colum_name_buf),system_charset_info);
|
||||
String column_name(colum_name_buf,sizeof(colum_name_buf),my_charset_latin1);
|
||||
|
||||
privileges&= ~rights;
|
||||
table->field[6]->store((longlong)
|
||||
@ -1955,10 +1955,10 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
|
||||
}
|
||||
|
||||
restore_record(table,2); // Get empty record
|
||||
table->field[0]->store(combo.host.str,combo.host.length, system_charset_info);
|
||||
table->field[1]->store(db,(uint) strlen(db), system_charset_info);
|
||||
table->field[2]->store(combo.user.str,combo.user.length, system_charset_info);
|
||||
table->field[3]->store(table_name,(uint) strlen(table_name), system_charset_info);
|
||||
table->field[0]->store(combo.host.str,combo.host.length, my_charset_latin1);
|
||||
table->field[1]->store(db,(uint) strlen(db), my_charset_latin1);
|
||||
table->field[2]->store(combo.user.str,combo.user.length, my_charset_latin1);
|
||||
table->field[3]->store(table_name,(uint) strlen(table_name), my_charset_latin1);
|
||||
store_record(table,1); // store at pos 1
|
||||
|
||||
if (table->file->index_read_idx(table->record[0],0,
|
||||
@ -2003,7 +2003,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
|
||||
}
|
||||
}
|
||||
|
||||
table->field[4]->store(grantor,(uint) strlen(grantor), system_charset_info);
|
||||
table->field[4]->store(grantor,(uint) strlen(grantor), my_charset_latin1);
|
||||
table->field[6]->store((longlong) store_table_rights);
|
||||
table->field[7]->store((longlong) store_col_rights);
|
||||
rights=fix_rights_for_table(store_table_rights);
|
||||
@ -2263,7 +2263,7 @@ int mysql_grant (THD *thd, const char *db, List <LEX_USER> &list,
|
||||
if (lower_case_table_names && db)
|
||||
{
|
||||
strmov(tmp_db,db);
|
||||
my_casedn_str(system_charset_info, tmp_db);
|
||||
my_casedn_str(my_charset_latin1, tmp_db);
|
||||
db=tmp_db;
|
||||
}
|
||||
|
||||
@ -2352,7 +2352,7 @@ my_bool grant_init(THD *org_thd)
|
||||
DBUG_ENTER("grant_init");
|
||||
|
||||
grant_option = FALSE;
|
||||
(void) hash_init(&hash_tables,system_charset_info,
|
||||
(void) hash_init(&hash_tables,my_charset_latin1,
|
||||
0,0,0, (hash_get_key) get_grant_table,
|
||||
(hash_free_key) free_grant_table,0);
|
||||
init_sql_alloc(&memex,1024,0);
|
||||
@ -2681,9 +2681,9 @@ bool check_grant_db(THD *thd,const char *db)
|
||||
GRANT_TABLE *grant_table = (GRANT_TABLE*) hash_element(&hash_tables,idx);
|
||||
if (len < grant_table->key_length &&
|
||||
!memcmp(grant_table->hash_key,helping,len) &&
|
||||
(thd->host && !wild_case_compare(system_charset_info,
|
||||
(thd->host && !wild_case_compare(my_charset_latin1,
|
||||
thd->host,grant_table->host) ||
|
||||
(thd->ip && !wild_case_compare(system_charset_info,
|
||||
(thd->ip && !wild_case_compare(my_charset_latin1,
|
||||
thd->ip,grant_table->host))))
|
||||
{
|
||||
error=0; // Found match
|
||||
@ -2805,7 +2805,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
|
||||
if (!(host=acl_user->host.hostname))
|
||||
host="%";
|
||||
if (!strcmp(lex_user->user.str,user) &&
|
||||
!my_strcasecmp(system_charset_info, lex_user->host.str, host))
|
||||
!my_strcasecmp(my_charset_latin1, lex_user->host.str, host))
|
||||
break;
|
||||
}
|
||||
if (counter == acl_users.elements)
|
||||
@ -2815,7 +2815,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
Item_string *field=new Item_string("",0,system_charset_info);
|
||||
Item_string *field=new Item_string("",0,my_charset_latin1);
|
||||
List<Item> field_list;
|
||||
field->name=buff;
|
||||
field->max_length=1024;
|
||||
@ -2833,7 +2833,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
|
||||
acl_user->ssl_type != SSL_TYPE_NONE)
|
||||
{
|
||||
want_access=acl_user->access;
|
||||
String global(buff,sizeof(buff),system_charset_info);
|
||||
String global(buff,sizeof(buff),my_charset_latin1);
|
||||
global.length(0);
|
||||
global.append("GRANT ",6);
|
||||
|
||||
@ -2952,12 +2952,12 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
|
||||
host="";
|
||||
|
||||
if (!strcmp(lex_user->user.str,user) &&
|
||||
!my_strcasecmp(system_charset_info, lex_user->host.str, host))
|
||||
!my_strcasecmp(my_charset_latin1, lex_user->host.str, host))
|
||||
{
|
||||
want_access=acl_db->access;
|
||||
if (want_access)
|
||||
{
|
||||
String db(buff,sizeof(buff),system_charset_info);
|
||||
String db(buff,sizeof(buff),my_charset_latin1);
|
||||
db.length(0);
|
||||
db.append("GRANT ",6);
|
||||
|
||||
@ -3011,12 +3011,12 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
|
||||
host="";
|
||||
|
||||
if (!strcmp(lex_user->user.str,user) &&
|
||||
!my_strcasecmp(system_charset_info, lex_user->host.str, host))
|
||||
!my_strcasecmp(my_charset_latin1, lex_user->host.str, host))
|
||||
{
|
||||
want_access=grant_table->privs;
|
||||
if ((want_access | grant_table->cols) != 0)
|
||||
{
|
||||
String global(buff,sizeof(buff),system_charset_info);
|
||||
String global(buff,sizeof(buff),my_charset_latin1);
|
||||
global.length(0);
|
||||
global.append("GRANT ",6);
|
||||
|
||||
|
@ -97,14 +97,7 @@ bool String::set(longlong num, CHARSET_INFO *cs)
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
if (cs->snprintf == my_snprintf_8bit)
|
||||
{
|
||||
str_length=(uint32) (longlong10_to_str(num,Ptr,-10)-Ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_length=cs->snprintf(cs,Ptr,l,"%d",num);
|
||||
}
|
||||
str_length=(uint32) cs->ll10tostr(cs,Ptr,l,-10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
@ -115,14 +108,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
if (cs->snprintf == my_snprintf_8bit)
|
||||
{
|
||||
str_length=(uint32) (longlong10_to_str(num,Ptr,10)-Ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_length=cs->snprintf(cs,Ptr,l,"%d",num);
|
||||
}
|
||||
str_length=(uint32) cs->ll10tostr(cs,Ptr,l,10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -6249,6 +6249,9 @@ CHARSET_INFO my_charset_big5 =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -290,12 +290,13 @@ static CHARSET_INFO my_charset_bin_st =
|
||||
my_hash_sort_bin, /* hash_sort */
|
||||
255, /* max_sort_char */
|
||||
my_snprintf_8bit, /* snprintf */
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
|
||||
my_strntod_8bit,
|
||||
};
|
||||
|
||||
|
||||
|
@ -627,6 +627,8 @@ CHARSET_INFO my_charset_czech =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -8667,6 +8667,8 @@ CHARSET_INFO my_charset_euc_kr =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -5717,6 +5717,8 @@ CHARSET_INFO my_charset_gb2312 =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -9904,11 +9904,13 @@ CHARSET_INFO my_charset_gbk =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
};
|
||||
|
||||
|
||||
|
@ -445,6 +445,8 @@ CHARSET_INFO my_charset_latin1_de =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -710,6 +710,109 @@ double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
This is a fast version optimized for the case of radix 10 / -10
|
||||
*/
|
||||
|
||||
int my_l10tostr_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||
char *dst, uint len, int radix, long int val)
|
||||
{
|
||||
char buffer[66];
|
||||
register char *p, *e;
|
||||
long int new_val;
|
||||
int sl=0;
|
||||
uint l;
|
||||
|
||||
e = p = &buffer[sizeof(buffer)-1];
|
||||
*e='\0';
|
||||
|
||||
if (radix < 0)
|
||||
{
|
||||
if (val < 0)
|
||||
{
|
||||
sl = 1;
|
||||
val = -val;
|
||||
}
|
||||
}
|
||||
|
||||
new_val = (long) ((unsigned long int) val / 10);
|
||||
*--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10);
|
||||
val = new_val;
|
||||
|
||||
while (val != 0)
|
||||
{
|
||||
new_val=val/10;
|
||||
*--p = '0' + (char) (val-new_val*10);
|
||||
val= new_val;
|
||||
}
|
||||
|
||||
if (sl)
|
||||
{
|
||||
*--p='-';
|
||||
}
|
||||
|
||||
l=e-p;
|
||||
l=(l>len)?len:l;
|
||||
memcpy(dst,p,l);
|
||||
return (int)l;
|
||||
}
|
||||
|
||||
int my_ll10tostr_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||
char *dst, uint len, int radix, longlong val)
|
||||
{
|
||||
char buffer[65];
|
||||
register char *p, *e;
|
||||
long long_val;
|
||||
int sl=0;
|
||||
uint l;
|
||||
|
||||
if (radix < 0)
|
||||
{
|
||||
if (val < 0)
|
||||
{
|
||||
sl=1;
|
||||
val = -val;
|
||||
}
|
||||
}
|
||||
|
||||
e = p = &buffer[sizeof(buffer)-1];
|
||||
*p='\0';
|
||||
|
||||
if (val == 0)
|
||||
{
|
||||
*--p='0';
|
||||
goto cnv;
|
||||
}
|
||||
|
||||
while ((ulonglong) val > (ulonglong) LONG_MAX)
|
||||
{
|
||||
ulonglong quo=(ulonglong) val/(uint) 10;
|
||||
uint rem= (uint) (val- quo* (uint) 10);
|
||||
*--p = '0' + rem;
|
||||
val= quo;
|
||||
}
|
||||
|
||||
long_val= (long) val;
|
||||
while (long_val != 0)
|
||||
{
|
||||
long quo= long_val/10;
|
||||
*--p = '0' + (long_val - quo*10);
|
||||
long_val= quo;
|
||||
}
|
||||
|
||||
cnv:
|
||||
if (sl)
|
||||
{
|
||||
*--p='-';
|
||||
}
|
||||
|
||||
l=e-p;
|
||||
l=(l>len)?len:l;
|
||||
memcpy(dst,p,l);
|
||||
return (int)(e-p);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Compare string against string with wildcard
|
||||
** 0 if matched
|
||||
|
@ -4491,6 +4491,8 @@ CHARSET_INFO my_charset_sjis =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -719,6 +719,8 @@ CHARSET_INFO my_charset_tis620 =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -8461,6 +8461,8 @@ CHARSET_INFO my_charset_ujis =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -1989,11 +1989,13 @@ CHARSET_INFO my_charset_utf8 =
|
||||
my_hash_sort_utf8, /* hash_sort */
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
};
|
||||
|
||||
|
||||
@ -2908,6 +2910,117 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
This is a fast version optimized for the case of radix 10 / -10
|
||||
*/
|
||||
|
||||
int my_l10tostr_ucs2(CHARSET_INFO *cs,
|
||||
char *dst, uint len, int radix, long int val)
|
||||
{
|
||||
char buffer[66];
|
||||
register char *p, *db, *de;
|
||||
long int new_val;
|
||||
int sl=0;
|
||||
|
||||
p = &buffer[sizeof(buffer)-1];
|
||||
*p='\0';
|
||||
|
||||
if (radix < 0)
|
||||
{
|
||||
if (val < 0)
|
||||
{
|
||||
sl = 1;
|
||||
val = -val;
|
||||
}
|
||||
}
|
||||
|
||||
new_val = (long) ((unsigned long int) val / 10);
|
||||
*--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10);
|
||||
val = new_val;
|
||||
|
||||
while (val != 0)
|
||||
{
|
||||
new_val=val/10;
|
||||
*--p = '0' + (char) (val-new_val*10);
|
||||
val= new_val;
|
||||
}
|
||||
|
||||
if (sl)
|
||||
{
|
||||
*--p='-';
|
||||
}
|
||||
|
||||
for ( db=dst, de=dst+len ; (dst<de) && *p ; p++)
|
||||
{
|
||||
int cnvres=cs->wc_mb(cs,(my_wc_t)p[0],dst,de);
|
||||
if (cnvres>0)
|
||||
dst+=cnvres;
|
||||
else
|
||||
break;
|
||||
}
|
||||
return (int) (dst-db);
|
||||
}
|
||||
|
||||
int my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
||||
char *dst, uint len, int radix, longlong val)
|
||||
{
|
||||
char buffer[65];
|
||||
register char *p, *db, *de;
|
||||
long long_val;
|
||||
int sl=0;
|
||||
|
||||
if (radix < 0)
|
||||
{
|
||||
if (val < 0)
|
||||
{
|
||||
sl=1;
|
||||
val = -val;
|
||||
}
|
||||
}
|
||||
|
||||
p = &buffer[sizeof(buffer)-1];
|
||||
*p='\0';
|
||||
|
||||
if (val == 0)
|
||||
{
|
||||
*--p='0';
|
||||
goto cnv;
|
||||
}
|
||||
|
||||
while ((ulonglong) val > (ulonglong) LONG_MAX)
|
||||
{
|
||||
ulonglong quo=(ulonglong) val/(uint) 10;
|
||||
uint rem= (uint) (val- quo* (uint) 10);
|
||||
*--p = '0' + rem;
|
||||
val= quo;
|
||||
}
|
||||
|
||||
long_val= (long) val;
|
||||
while (long_val != 0)
|
||||
{
|
||||
long quo= long_val/10;
|
||||
*--p = '0' + (long_val - quo*10);
|
||||
long_val= quo;
|
||||
}
|
||||
|
||||
cnv:
|
||||
if (sl)
|
||||
{
|
||||
*--p='-';
|
||||
}
|
||||
|
||||
for ( db=dst, de=dst+len ; (dst<de) && *p ; p++)
|
||||
{
|
||||
int cnvres=cs->wc_mb(cs,(my_wc_t)p[0],dst,de);
|
||||
if (cnvres>0)
|
||||
dst+=cnvres;
|
||||
else
|
||||
break;
|
||||
}
|
||||
return (int) (dst-db);
|
||||
}
|
||||
|
||||
|
||||
CHARSET_INFO my_charset_ucs2 =
|
||||
{
|
||||
35, /* number */
|
||||
@ -2942,6 +3055,8 @@ CHARSET_INFO my_charset_ucs2 =
|
||||
my_hash_sort_ucs2, /* hash_sort */
|
||||
0,
|
||||
my_snprintf_ucs2,
|
||||
my_l10tostr_ucs2,
|
||||
my_ll10tostr_ucs2,
|
||||
my_strntol_ucs2,
|
||||
my_strntoul_ucs2,
|
||||
my_strntoll_ucs2,
|
||||
|
@ -653,6 +653,8 @@ CHARSET_INFO my_charset_win1250ch =
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
|
@ -2841,6 +2841,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -2883,7 +2885,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -2925,7 +2929,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -2967,7 +2973,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3010,7 +3018,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3052,7 +3062,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3094,7 +3106,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3136,7 +3150,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3179,7 +3195,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3221,7 +3239,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3263,7 +3283,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3305,7 +3327,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3347,7 +3371,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3389,7 +3415,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3431,7 +3459,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3474,7 +3504,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3516,7 +3548,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3559,7 +3593,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3602,7 +3638,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3644,7 +3682,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3686,7 +3726,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3728,7 +3770,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3770,7 +3814,9 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0,
|
||||
my_snprintf_8bit
|
||||
my_snprintf_8bit,
|
||||
my_l10tostr_8bit,
|
||||
my_ll10tostr_8bit,
|
||||
my_strntol_8bit,
|
||||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
@ -3818,6 +3864,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user