mirror of
https://github.com/MariaDB/server.git
synced 2025-07-18 23:03:28 +03:00
Portability fixes
Fixed wrong number of warnings/duplicates for machines with high-byte-first
This commit is contained in:
@ -1239,7 +1239,6 @@ static void fix_history(String *final_command)
|
|||||||
static int not_in_history(const char *line)
|
static int not_in_history(const char *line)
|
||||||
{
|
{
|
||||||
HIST_ENTRY *oldhist = history_get(history_length);
|
HIST_ENTRY *oldhist = history_get(history_length);
|
||||||
int num;
|
|
||||||
|
|
||||||
if (oldhist == 0)
|
if (oldhist == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -1589,7 +1588,6 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
|||||||
const char *server_cmd= buffer->ptr();
|
const char *server_cmd= buffer->ptr();
|
||||||
char cmd_buf[100];
|
char cmd_buf[100];
|
||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
MYSQL_FIELD *fields;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (help_arg[0] != '\'')
|
if (help_arg[0] != '\'')
|
||||||
@ -1615,7 +1613,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
|||||||
{
|
{
|
||||||
unsigned int num_fields= mysql_num_fields(result);
|
unsigned int num_fields= mysql_num_fields(result);
|
||||||
my_ulonglong num_rows= mysql_num_rows(result);
|
my_ulonglong num_rows= mysql_num_rows(result);
|
||||||
fields= mysql_fetch_fields(result);
|
mysql_fetch_fields(result);
|
||||||
if (num_fields==3 && num_rows==1)
|
if (num_fields==3 && num_rows==1)
|
||||||
{
|
{
|
||||||
if (!(cur= mysql_fetch_row(result)))
|
if (!(cur= mysql_fetch_row(result)))
|
||||||
|
@ -109,7 +109,7 @@ MYSQL_MANAGER* manager=0;
|
|||||||
|
|
||||||
static char **default_argv;
|
static char **default_argv;
|
||||||
static const char *load_default_groups[]= { "mysqltest","client",0 };
|
static const char *load_default_groups[]= { "mysqltest","client",0 };
|
||||||
static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;;
|
static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;
|
||||||
|
|
||||||
static FILE* file_stack[MAX_INCLUDE_DEPTH];
|
static FILE* file_stack[MAX_INCLUDE_DEPTH];
|
||||||
static FILE** cur_file;
|
static FILE** cur_file;
|
||||||
|
@ -90,8 +90,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
|
|||||||
|
|
||||||
/* Skip rows inserted by current inserted */
|
/* Skip rows inserted by current inserted */
|
||||||
for (r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root) ;
|
for (r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root) ;
|
||||||
(subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 &&
|
!r &&
|
||||||
!r && info->lastpos >= info->state->data_file_length ;
|
(subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 &&
|
||||||
|
info->lastpos >= info->state->data_file_length ;
|
||||||
r= _mi_search_next(info, keyinfo, info->lastkey,
|
r= _mi_search_next(info, keyinfo, info->lastkey,
|
||||||
info->lastkey_length, SEARCH_BIGGER, key_root))
|
info->lastkey_length, SEARCH_BIGGER, key_root))
|
||||||
;
|
;
|
||||||
|
@ -39,7 +39,7 @@ int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int run_test(const char *filename)
|
static int run_test(const char *filename)
|
||||||
{
|
{
|
||||||
MI_INFO *file;
|
MI_INFO *file;
|
||||||
MI_UNIQUEDEF uniquedef;
|
MI_UNIQUEDEF uniquedef;
|
||||||
|
@ -10,4 +10,4 @@ reset slave;
|
|||||||
start slave;
|
start slave;
|
||||||
show slave status;
|
show slave status;
|
||||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 326 None 0 No #
|
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 # None 0 No #
|
||||||
|
@ -21,5 +21,5 @@ start slave;
|
|||||||
# can't sync_with_master so we must sleep
|
# can't sync_with_master so we must sleep
|
||||||
sleep 3;
|
sleep 3;
|
||||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||||
--replace_column 1 # 33 #
|
--replace_column 1 # 23 # 33 #
|
||||||
show slave status;
|
show slave status;
|
||||||
|
@ -411,7 +411,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
|
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
|
||||||
else
|
else
|
||||||
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
||||||
(ulong) info.deleted+info.updated, (ulong) thd->cuted_fields);
|
(ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
|
||||||
::send_ok(thd,info.copied+info.deleted+info.updated,(ulonglong)id,buff);
|
::send_ok(thd,info.copied+info.deleted+info.updated,(ulonglong)id,buff);
|
||||||
}
|
}
|
||||||
free_underlaid_joins(thd, &thd->lex->select_lex);
|
free_underlaid_joins(thd, &thd->lex->select_lex);
|
||||||
@ -1582,7 +1582,7 @@ bool select_insert::send_eof()
|
|||||||
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
|
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
|
||||||
else
|
else
|
||||||
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
||||||
(ulong) info.deleted+info.updated, (ulong) thd->cuted_fields);
|
(ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
|
||||||
::send_ok(thd,info.copied+info.deleted+info.updated,last_insert_id,buff);
|
::send_ok(thd,info.copied+info.deleted+info.updated,last_insert_id,buff);
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ static uint16 big5strokexfrm(uint16 i)
|
|||||||
static int my_strnncoll_big5_internal(const uchar **a_res,
|
static int my_strnncoll_big5_internal(const uchar **a_res,
|
||||||
const uchar **b_res, uint length)
|
const uchar **b_res, uint length)
|
||||||
{
|
{
|
||||||
const char *a= *a_res, *b= *b_res;
|
const uchar *a= *a_res, *b= *b_res;
|
||||||
|
|
||||||
while (length--)
|
while (length--)
|
||||||
{
|
{
|
||||||
@ -236,10 +236,10 @@ static int my_strnncoll_big5_internal(const uchar **a_res,
|
|||||||
b+= 2;
|
b+= 2;
|
||||||
length--;
|
length--;
|
||||||
}
|
}
|
||||||
else if (sort_order_big5[(uchar) *a++] !=
|
else if (sort_order_big5[*a++] !=
|
||||||
sort_order_big5[(uchar) *b++])
|
sort_order_big5[*b++])
|
||||||
return ((int) sort_order_big5[(uchar) a[-1]] -
|
return ((int) sort_order_big5[a[-1]] -
|
||||||
(int) sort_order_big5[(uchar) b[-1]]);
|
(int) sort_order_big5[b[-1]]);
|
||||||
}
|
}
|
||||||
*a_res= a;
|
*a_res= a;
|
||||||
*b_res= b;
|
*b_res= b;
|
||||||
|
@ -2585,7 +2585,7 @@ static uint16 gbksortorder(uint16 i)
|
|||||||
int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
|
int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
|
||||||
uint length)
|
uint length)
|
||||||
{
|
{
|
||||||
const char *a= *a_res, *b= *b_res;
|
const uchar *a= *a_res, *b= *b_res;
|
||||||
uint a_char,b_char;
|
uint a_char,b_char;
|
||||||
|
|
||||||
while (length--)
|
while (length--)
|
||||||
@ -2601,9 +2601,9 @@ int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
|
|||||||
b+= 2;
|
b+= 2;
|
||||||
length--;
|
length--;
|
||||||
}
|
}
|
||||||
else if (sort_order_gbk[(uchar) *a++] != sort_order_gbk[(uchar) *b++])
|
else if (sort_order_gbk[*a++] != sort_order_gbk[*b++])
|
||||||
return ((int) sort_order_gbk[(uchar) a[-1]] -
|
return ((int) sort_order_gbk[a[-1]] -
|
||||||
(int) sort_order_gbk[(uchar) b[-1]]);
|
(int) sort_order_gbk[b[-1]]);
|
||||||
}
|
}
|
||||||
*a_res= a;
|
*a_res= a;
|
||||||
*b_res= b;
|
*b_res= b;
|
||||||
|
@ -283,7 +283,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs,
|
|||||||
|
|
||||||
while (pos)
|
while (pos)
|
||||||
{
|
{
|
||||||
if ((mblen= cs->cset->mb_wc(cs, &wc, b, e)) <0)
|
if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <0)
|
||||||
break;
|
break;
|
||||||
b+= mblen;
|
b+= mblen;
|
||||||
pos--;
|
pos--;
|
||||||
|
@ -6750,8 +6750,8 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs,
|
|||||||
int s_res;
|
int s_res;
|
||||||
int t_res;
|
int t_res;
|
||||||
|
|
||||||
slen= cs->cset->lengthsp(cs, s, slen);
|
slen= cs->cset->lengthsp(cs, (char*) s, slen);
|
||||||
tlen= cs->cset->lengthsp(cs, t, tlen);
|
tlen= cs->cset->lengthsp(cs, (char*) t, tlen);
|
||||||
|
|
||||||
my_uca_scanner_init(&sscanner, cs, s, slen);
|
my_uca_scanner_init(&sscanner, cs, s, slen);
|
||||||
my_uca_scanner_init(&tscanner, cs, t, tlen);
|
my_uca_scanner_init(&tscanner, cs, t, tlen);
|
||||||
@ -6796,7 +6796,7 @@ static void my_hash_sort_uca(CHARSET_INFO *cs,
|
|||||||
int s_res;
|
int s_res;
|
||||||
my_uca_scanner scanner;
|
my_uca_scanner scanner;
|
||||||
|
|
||||||
slen= cs->cset->lengthsp(cs, s, slen);
|
slen= cs->cset->lengthsp(cs, (char*) s, slen);
|
||||||
my_uca_scanner_init(&scanner, cs, s, slen);
|
my_uca_scanner_init(&scanner, cs, s, slen);
|
||||||
|
|
||||||
while ((s_res= my_uca_scanner_next(&scanner)) >0)
|
while ((s_res= my_uca_scanner_next(&scanner)) >0)
|
||||||
|
@ -2400,7 +2400,8 @@ static void test_long_data_str()
|
|||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
int rc, i;
|
int rc, i;
|
||||||
char data[255];
|
char data[255];
|
||||||
long length, length1;
|
long length;
|
||||||
|
ulong length1;
|
||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
MYSQL_BIND bind[2];
|
MYSQL_BIND bind[2];
|
||||||
my_bool is_null[2];
|
my_bool is_null[2];
|
||||||
@ -2495,8 +2496,8 @@ static void test_long_data_str1()
|
|||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
int rc, i;
|
int rc, i;
|
||||||
char data[255];
|
char data[255];
|
||||||
long length, length1;
|
long length;
|
||||||
ulong max_blob_length, blob_length;
|
ulong max_blob_length, blob_length, length1;
|
||||||
my_bool true_value;
|
my_bool true_value;
|
||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
MYSQL_BIND bind[2];
|
MYSQL_BIND bind[2];
|
||||||
@ -3084,7 +3085,7 @@ static void test_bind_result_ext()
|
|||||||
char szData[20], bData[20];
|
char szData[20], bData[20];
|
||||||
ulong szLength, bLength;
|
ulong szLength, bLength;
|
||||||
MYSQL_BIND bind[8];
|
MYSQL_BIND bind[8];
|
||||||
long length[8];
|
ulong length[8];
|
||||||
my_bool is_null[8];
|
my_bool is_null[8];
|
||||||
|
|
||||||
myheader("test_bind_result_ext");
|
myheader("test_bind_result_ext");
|
||||||
@ -5376,7 +5377,7 @@ static void test_store_result2()
|
|||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
int rc;
|
int rc;
|
||||||
int nData;
|
int nData;
|
||||||
long length;
|
ulong length;
|
||||||
MYSQL_BIND bind[1];
|
MYSQL_BIND bind[1];
|
||||||
|
|
||||||
myheader("test_store_result2");
|
myheader("test_store_result2");
|
||||||
@ -8094,7 +8095,7 @@ static void test_ts()
|
|||||||
MYSQL_TIME ts;
|
MYSQL_TIME ts;
|
||||||
MYSQL_RES *prep_res;
|
MYSQL_RES *prep_res;
|
||||||
char strts[30];
|
char strts[30];
|
||||||
long length;
|
ulong length;
|
||||||
int rc, field_count;
|
int rc, field_count;
|
||||||
char name;
|
char name;
|
||||||
|
|
||||||
@ -8974,7 +8975,8 @@ static void test_multi()
|
|||||||
char *query;
|
char *query;
|
||||||
MYSQL_BIND bind[1];
|
MYSQL_BIND bind[1];
|
||||||
int rc, i;
|
int rc, i;
|
||||||
long param= 1, length= 1;
|
long param= 1;
|
||||||
|
ulong length= 1;
|
||||||
myheader("test_multi");
|
myheader("test_multi");
|
||||||
|
|
||||||
bind[0].buffer_type= MYSQL_TYPE_LONG;
|
bind[0].buffer_type= MYSQL_TYPE_LONG;
|
||||||
@ -9100,7 +9102,7 @@ static void test_bind_nagative()
|
|||||||
int rc;
|
int rc;
|
||||||
MYSQL_BIND bind[1];
|
MYSQL_BIND bind[1];
|
||||||
long my_val = 0L;
|
long my_val = 0L;
|
||||||
long my_length = 0L;
|
ulong my_length = 0L;
|
||||||
long my_null = 0L;
|
long my_null = 0L;
|
||||||
myheader("test_insert_select");
|
myheader("test_insert_select");
|
||||||
|
|
||||||
@ -9141,7 +9143,7 @@ static void test_derived()
|
|||||||
int rc, i;
|
int rc, i;
|
||||||
MYSQL_BIND bind[1];
|
MYSQL_BIND bind[1];
|
||||||
long my_val = 0L;
|
long my_val = 0L;
|
||||||
long my_length = 0L;
|
ulong my_length = 0L;
|
||||||
long my_null = 0L;
|
long my_null = 0L;
|
||||||
const char *query=
|
const char *query=
|
||||||
"select count(1) from (select f.id from t1 f where f.id=?) as x";
|
"select count(1) from (select f.id from t1 f where f.id=?) as x";
|
||||||
|
Reference in New Issue
Block a user