Commit 8aeb63dd authored by monty@mysql.com's avatar monty@mysql.com

Update VC++ files

Portability fixes
After merge fixes
parent 32a62d50
......@@ -251,6 +251,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
......@@ -275,6 +278,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
......@@ -311,6 +317,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
......
......@@ -298,6 +298,10 @@ SOURCE=.\my_copy.c
# End Source File
# Begin Source File
SOURCE=.\my_crc32.c
# End Source File
# Begin Source File
SOURCE=.\my_create.c
# End Source File
# Begin Source File
......
......@@ -309,6 +309,8 @@ static int get_options(int *argc, char ***argv)
else
what_to_do = DO_CHECK;
}
/* TODO: This variable is not yet used */
if (!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME))))
exit(1);
......
......@@ -118,7 +118,6 @@ static FILE** cur_file;
static FILE** file_stack_end;
static uint lineno_stack[MAX_INCLUDE_DEPTH];
static char TMPDIR[FN_REFLEN];
static int *block_ok_stack_end;
static int *cur_block, *block_stack_end;
static int block_stack[BLOCK_STACK_DEPTH];
......@@ -1495,7 +1494,6 @@ int do_connect(struct st_query* q)
char* p=q->first_argument;
char buff[FN_REFLEN];
int con_port;
int con_error;
int free_con_sock = 0;
DBUG_ENTER("do_connect");
......@@ -1560,7 +1558,7 @@ int do_connect(struct st_query* q)
/* Special database to allow one to connect without a database name */
if (con_db && !strcmp(con_db,"*NO-ONE*"))
con_db=0;
if ((con_error = safe_connect(&next_con->mysql, con_host,
if ((safe_connect(&next_con->mysql, con_host,
con_user, con_pass,
con_db, con_port, con_sock ? con_sock: 0)))
die("Could not open connection '%s': %s", con_name,
......@@ -2018,12 +2016,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int parse_args(int argc, char **argv)
{
int ho_error;
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(1);
if (argc > 1)
......@@ -2454,7 +2450,6 @@ int main(int argc, char **argv)
memset(block_stack, 0, sizeof(block_stack));
block_stack_end = block_stack + BLOCK_STACK_DEPTH;
memset(block_ok_stack, 0, sizeof(block_stack));
block_ok_stack_end = block_ok_stack + BLOCK_STACK_DEPTH;
cur_block = block_stack;
block_ok = block_ok_stack;
*block_ok = 1;
......
......@@ -91,9 +91,6 @@ typedef struct st_key_cache
ulong global_cache_read; /* number of reads from files to the cache */
int blocks; /* max number of blocks in the cache */
my_bool in_init; /* Set to 1 in MySQL during init/resize */
/* optional call back function */
void (*action)(struct st_key_cache *);
} KEY_CACHE;
/* The default key cache */
......
......@@ -335,6 +335,14 @@ uint my_instr_mb(struct charset_info_st *,
extern my_bool my_parse_charset_xml(const char *bug, uint len,
int (*add)(CHARSET_INFO *cs));
#undef _U
#undef _L
#undef _NMR
#undef _SPC
#undef _PNT
#undef _CTR
#undef _B
#undef _X
#define _U 01 /* Upper case */
#define _L 02 /* Lower case */
......
......@@ -46,7 +46,6 @@
#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */
#define HA_OPEN_ABORT_IF_CRASHED 16
#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
#define HA_OPEN_TO_ASSIGN 64 /* Open for key cache assignment */
/* The following is parameter to ha_rkey() how to use key */
......
......@@ -92,6 +92,11 @@ int mi_assign_to_key_cache(MI_INFO *info,
*/
(void) flush_key_blocks(key_cache, share->kfile, FLUSH_REMOVE);
/*
ensure that setting the key cache and changing the multi_key_cache
is done atomicly
*/
pthread_mutex_lock(&share->intern_lock);
/*
Tell all threads to use the new key cache
This should be seen at the lastes for the next call to an myisam function.
......@@ -102,6 +107,7 @@ int mi_assign_to_key_cache(MI_INFO *info,
if (multi_key_cache_set(share->unique_file_name, share->unique_name_length,
share->key_cache))
error= my_errno;
pthread_mutex_unlock(&share->intern_lock);
DBUG_RETURN(error);
}
......
......@@ -5,3 +5,4 @@ COUNT(*)
4181000
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
DROP TABLE t1;
set @@read_buffer_size=default;
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
select get_lock("a",5);
get_lock("a",5)
1
......@@ -15,12 +15,12 @@ select * from t1;
n
1
show slave status;
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 Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root 9306 1 master-bin.001 273 slave-relay-bin.002 255 master-bin.001 No No 0 0 214 314
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 9306 1 master-bin.000001 273 slave-relay-bin.000002 258 master-bin.000001 No No 0 0 214 317 None 0 No #
change master to master_user='root';
show slave status;
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 Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root 9306 1 master-bin.001 214 slave-relay-bin.001 4 master-bin.001 No No 0 0 214 4
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 9306 1 master-bin.000001 214 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 214 4 None 0 No #
select release_lock("a");
release_lock("a")
1
......
......@@ -21,6 +21,7 @@ while ($1)
INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev);
dec $1;
}
set @@read_buffer_size=2*1024*1024;
CREATE TABLE t2 SELECT * FROM t1;
INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
......@@ -53,3 +54,5 @@ SELECT COUNT(*) FROM t1;
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
--enable_result_log
DROP TABLE t1;
set @@read_buffer_size=default;
......@@ -11,8 +11,10 @@ connection slave;
sleep 3; # can't sync_with_master as we should be blocked
stop slave;
select * from t1;
--replace_column 1 # 33 #
show slave status;
change master to master_user='root';
--replace_column 1 # 33 #
show slave status;
# Will restart from after the values(2), which is bug
select release_lock("a");
......
......@@ -251,6 +251,7 @@ int load_defaults(const char *conf_file, const char **groups,
err:
fprintf(stderr,"Fatal error in defaults handling. Program aborted\n");
exit(1);
return 0; /* Keep compiler happy */
}
......
......@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
These functions are to handle keyblock cacheing
for NISAM, MISAM and PISAM databases.
These functions handle keyblock cacheing for ISAM and MyISAM tables.
One cache can handle many files.
It must contain buffers of the same blocksize.
init_key_cache() should be used to init cache handler.
......@@ -282,6 +282,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
if (! keycache->key_cache_inited)
{
keycache->key_cache_inited= 1;
keycache->in_init= 0;
pthread_mutex_init(&keycache->cache_lock, MY_MUTEX_INIT_FAST);
}
......@@ -2159,9 +2160,6 @@ static int flush_key_blocks_int(KEY_CACHE *keycache,
}
}
if (type == FLUSH_REMOVE && keycache->action)
(*keycache->action)(keycache);
#ifndef DBUG_OFF
DBUG_EXECUTE("check_keycache",
test_key_cache(keycache, "end of flush_key_blocks", 0););
......
......@@ -83,7 +83,7 @@ int handle_options(int *argc, char ***argv,
char *))
{
uint opt_found, argvpos= 0, length, i;
my_bool end_of_options= 0, must_be_var, set_maximum_value, special_used,
my_bool end_of_options= 0, must_be_var, set_maximum_value,
option_is_loose;
char **pos, **pos_end, *optend, *prev_found,
*opt_str, key_name[FN_REFLEN];
......@@ -104,7 +104,6 @@ int handle_options(int *argc, char ***argv,
char *argument= 0;
must_be_var= 0;
set_maximum_value= 0;
special_used= 0;
option_is_loose= 0;
cur_arg++; /* skip '-' */
......@@ -202,7 +201,6 @@ int handle_options(int *argc, char ***argv,
/*
We were called with a special prefix, we can reuse opt_found
*/
special_used= 1;
opt_str+= (special_opt_prefix_lengths[i] + 1);
if (i == OPT_LOOSE)
option_is_loose= 1;
......
......@@ -720,13 +720,10 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
if ((error= mi_assign_to_key_cache(file, map, new_key_cache)))
{
switch (error) {
default:
char buf[80];
my_snprintf(buf, sizeof(buf),
"Failed to flush to index file (errno: %d)", error);
errmsg= buf;
}
error= HA_ADMIN_CORRUPT;
}
......
......@@ -1196,7 +1196,7 @@ int Item_uint::save_in_field(Field *field, bool no_conversions)
TODO: To be fixed when wen have a
field->store(longlong, unsigned_flag) method
*/
Item_int::save_in_field(field, no_conversions);
return Item_int::save_in_field(field, no_conversions);
}
......
......@@ -235,7 +235,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
/* Second part */
case 'f':
tmp= (char*) val_end;
l_time->second_part= my_strtoll10(val, &tmp, &error);
l_time->second_part= (int) my_strtoll10(val, &tmp, &error);
val= tmp;
break;
......@@ -1219,7 +1219,7 @@ String *Item_func_sec_to_time::val_str(String *str)
sec= (uint) ((ulonglong) seconds % 3600);
ltime.day= 0;
ltime.hour= seconds/3600;
ltime.hour= (uint) (seconds/3600);
ltime.minute= sec/60;
ltime.second= sec % 60;
......@@ -1852,7 +1852,6 @@ String *Item_datetime_typecast::val_str(String *str)
&ltime, str))
return str;
null_date:
null_value=1;
return 0;
}
......@@ -1911,8 +1910,8 @@ String *Item_date_typecast::val_str(String *str)
String *Item_func_makedate::val_str(String *str)
{
TIME l_time;
long daynr= args[1]->val_int();
long yearnr= args[0]->val_int();
long daynr= (long) args[1]->val_int();
long yearnr= (long) args[0]->val_int();
long days;
if (args[0]->null_value || args[1]->null_value ||
......@@ -1920,7 +1919,7 @@ String *Item_func_makedate::val_str(String *str)
goto err;
days= calc_daynr(yearnr,1,1) + daynr - 1;
// Day number from year 0 to 9999-12-31
/* Day number from year 0 to 9999-12-31 */
if (days >= 0 && days < MAX_DAY_NUMBER)
{
null_value=0;
......@@ -2124,7 +2123,8 @@ String *Item_func_timediff::val_str(String *str)
microseconds= l_time1.second_part - l_sign*l_time2.second_part;
seconds= ((longlong) days*86400L + l_time1.hour*3600L +
l_time1.minute*60L + l_time1.second + microseconds/1000000L -
(longlong)l_sign*(l_time2.hour*3600L+l_time2.minute*60L+l_time2.second));
(longlong)l_sign*(l_time2.hour*3600L+l_time2.minute*60L+
l_time2.second));
l_time3.neg= 0;
if (seconds < 0)
......@@ -2145,7 +2145,7 @@ String *Item_func_timediff::val_str(String *str)
if ((l_time2.neg == l_time1.neg) && l_time1.neg)
l_time3.neg= l_time3.neg ? 0 : 1;
calc_time_from_sec(&l_time3, seconds, microseconds);
calc_time_from_sec(&l_time3, (long) seconds, microseconds);
if (!make_datetime(l_time1.second_part || l_time2.second_part ?
TIME_MICROSECOND : TIME_ONLY,
......@@ -2167,9 +2167,9 @@ String *Item_func_maketime::val_str(String *str)
{
TIME ltime;
long hour= args[0]->val_int();
long minute= args[1]->val_int();
long second= args[2]->val_int();
long hour= (long) args[0]->val_int();
long minute= (long) args[1]->val_int();
long second= (long) args[2]->val_int();
if ((null_value=(args[0]->null_value ||
args[1]->null_value ||
......@@ -2185,9 +2185,9 @@ String *Item_func_maketime::val_str(String *str)
ltime.neg= 1;
hour= -hour;
}
ltime.hour= (ulong)hour;
ltime.minute= (ulong)minute;
ltime.second= (ulong)second;
ltime.hour= (ulong) hour;
ltime.minute= (ulong) minute;
ltime.second= (ulong) second;
make_time((DATE_TIME_FORMAT *) 0, &ltime, str);
return str;
}
......
......@@ -1884,7 +1884,7 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
bool sys_var_key_cache_long::update(THD *thd, set_var *var)
{
ulong tmp= var->value->val_int();
ulong tmp= (ulong) var->value->val_int();
LEX_STRING *base_name= &var->base;
bool error= 0;
......
......@@ -1056,7 +1056,6 @@ void mysql_stmt_reset(THD *thd, char *packet)
void mysql_stmt_free(THD *thd, char *packet)
{
ulong stmt_id= uint4korr(packet);
PREP_STMT *stmt;
DBUG_ENTER("mysql_stmt_free");
if (!find_prepared_statement(thd, stmt_id, "close"))
......
......@@ -1080,8 +1080,9 @@ int change_master(THD* thd, MASTER_INFO* mi)
of replication is not 100% clear, so we guard against problems using
max().
*/
mi->master_log_pos = max(BIN_LOG_HEADER_SIZE, mi->rli.master_log_pos);
strmake(mi->master_log_name,mi->rli.master_log_name,
mi->master_log_pos = max(BIN_LOG_HEADER_SIZE,
mi->rli.group_master_log_pos);
strmake(mi->master_log_name, mi->rli.group_master_log_name,
sizeof(mi->master_log_name)-1);
}
......
......@@ -166,11 +166,23 @@ class JOIN :public Sql_alloc
JOIN *tmp_join; // copy of this JOIN to be used with temporary tables
ROLLUP rollup; // Used with rollup
bool select_distinct, //Is select distinct?
no_order, simple_order, simple_group,
skip_sort_order, need_tmp,
hidden_group_fields,
buffer_result;
bool select_distinct; // Set if SELECT DISTINCT
/*
simple_xxxxx is set if ORDER/GROUP BY doesn't include any references
to other tables than the first non-constant table in the JOIN.
It's also set if ORDER/GROUP BY is empty.
*/
bool simple_order, simple_group;
/*
Is set only in case if we have a GROUP BY clause
and no ORDER BY after constant elimination of 'order'.
*/
bool no_order;
/* Is set if we have a GROUP BY and we have ORDER BY on a constant. */
bool skip_sort_order;
bool need_tmp, hidden_group_fields, buffer_result;
DYNAMIC_ARRAY keyuse;
Item::cond_result cond_value;
List<Item> all_fields; // to store all fields that used in query
......
......@@ -1652,8 +1652,7 @@ int mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables,
check_opt.key_cache= key_cache;
DBUG_RETURN(mysql_admin_table(thd, tables, &check_opt,
"assign_to_keycache", TL_READ_NO_INSERT, 0,
HA_OPEN_TO_ASSIGN, 0,
&handler::assign_to_keycache));
0, 0, &handler::assign_to_keycache));
}
......
......@@ -472,13 +472,13 @@ static uchar *thai2sortable(const uchar *tstr, uint len, uint *out_length)
const uchar *p= tstr;
uchar *outBuf;
uchar *pRight1, *pRight2, *pRight3;
uchar *pLeft1, *pLeft2, *pLeft3;
uchar *pLeft2, *pLeft3;
uint bufSize;
uint RightSize;
bufSize= (uint) (len + 1) * BUFFER_MULTIPLY;
RightSize= sizeof(uchar) * (len + 1);
if (!(outBuf= pLeft1= pRight1=
if (!(outBuf= pRight1=
(uchar *)malloc(sizeof(uchar) * bufSize + RightSize*2)))
{
/*
......@@ -608,8 +608,8 @@ int my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)),
int my_strcoll_tis620(const uchar * s1, const uchar * s2)
{
return my_strnncoll_tis620((CHARSET_INFO *) 0, s1, strlen(s1), s2,
strlen(s1));
return my_strnncoll_tis620((CHARSET_INFO *) 0, s1, strlen((char*) s1),
s2, strlen((char*) s1));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment