summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2002-10-08 22:28:24 +0300
committerunknown <monty@narttu.mysql.fi>2002-10-08 22:28:24 +0300
commit40c2e7499b40a10ee2b8042e5d672b7c4d4c66fe (patch)
tree362ce44d140ce7362c738d3068b9786f24043b0d /sql
parent58dc03066c8b8c38cdfa47e1f3c99ee002551b4f (diff)
downloadmariadb-git-40c2e7499b40a10ee2b8042e5d672b7c4d4c66fe.tar.gz
Portability fixes to be able to compile MySQL with VC++
VC++Files/client/mysqlclient.dsp: Updated VC++ files for 4.1 VC++Files/libmysql/libmysql.dsp: Updated VC++ files for 4.1 VC++Files/libmysqld/libmysqld.dsp: Updated VC++ files for 4.1 VC++Files/myisam/myisam.dsp: Updated VC++ files for 4.1 VC++Files/mysys/mysys.dsp: Updated VC++ files for 4.1 VC++Files/sql/mysqld.dsp: Updated VC++ files for 4.1 VC++Files/strings/strings.dsp: Updated VC++ files for 4.1 client/mysql.cc: Update for windows heap/_check.c: Fixed wrong DBUG_PRINT() usage include/mysql.h: Portability fix (uint -> unsigned int) libmysql/libmysql.def: Removed old my_casecmp function sql/ha_innodb.cc: Update for windows sql/init.cc: Removed not used variable sql/log.cc: Removed not used variable sql/net_pkg.cc: Portability fix sql/sql_db.cc: Portability fixes. Removed not used variables sql/sql_lex.h: Portability fix sql/sql_parse.cc: Portability fix sql/sql_prepare.cc: Removed not used variables sql/sql_select.cc: Portability fix sql/sql_show.cc: Portability fix sql/sql_union.cc: Portability fix
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc4
-rw-r--r--sql/init.cc1
-rw-r--r--sql/log.cc1
-rw-r--r--sql/net_pkg.cc4
-rw-r--r--sql/sql_db.cc7
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_parse.cc5
-rw-r--r--sql/sql_prepare.cc1
-rw-r--r--sql/sql_select.cc7
-rw-r--r--sql/sql_show.cc5
-rw-r--r--sql/sql_union.cc4
11 files changed, 17 insertions, 24 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index b684d9dd4dd..824169467af 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -3155,8 +3155,8 @@ innobase_drop_database(
memcpy(namebuf, ptr, len);
namebuf[len] = '/';
namebuf[len + 1] = '\0';
-#ifdef __WIN__
- casedn_str(namebuf);
+#ifdef FN_NO_CASE_SENCE
+ my_casedn_str(system_charset_info, namebuf);
#endif
trx = trx_allocate_for_mysql();
diff --git a/sql/init.cc b/sql/init.cc
index 052ee16925e..8834fd3a89c 100644
--- a/sql/init.cc
+++ b/sql/init.cc
@@ -24,7 +24,6 @@ void unireg_init(ulong options)
{
uint i;
double nr;
- CHARSET_INFO *cs;
DBUG_ENTER("unireg_init");
MYSYS_PROGRAM_DONT_USE_CURSES();
diff --git a/sql/log.cc b/sql/log.cc
index 59f99e3460e..8cb1577d745 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -973,7 +973,6 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
last_time=skr;
struct tm tm_tmp;
struct tm *start;
- ulong length;
localtime_r(&skr,&tm_tmp);
start=&tm_tmp;
/* Note that my_b_write() assumes it knows the length for this */
diff --git a/sql/net_pkg.cc b/sql/net_pkg.cc
index 9f91db95052..1da625e776f 100644
--- a/sql/net_pkg.cc
+++ b/sql/net_pkg.cc
@@ -273,12 +273,12 @@ send_eof(THD *thd, bool no_flush)
{
if (!no_flush && (thd->client_capabilities & CLIENT_PROTOCOL_41))
{
- char buff[5];
+ uchar buff[5];
uint tmp= min(thd->total_warn_count, 65535);
buff[0]=254;
int2store(buff+1, tmp);
int2store(buff+3, 0); // No flags yet
- VOID(my_net_write(net,buff,5));
+ VOID(my_net_write(net,(char*) buff,5));
VOID(net_flush(net));
}
else
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 1d843b78d4e..58b12bca00d 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -69,7 +69,6 @@ static bool write_db_opt(const char *path, HA_CREATE_INFO *create)
error=0;
my_close(file,MYF(0));
}
-exit:
return error;
}
@@ -104,7 +103,7 @@ static bool load_db_opt(const char *path, HA_CREATE_INFO *create)
IO_CACHE cache;
init_io_cache(&cache, file, IO_SIZE, READ_CACHE, 0, 0, MYF(0));
- while ((int) (nbytes= my_b_gets(&cache, (byte*) buf, sizeof(buf))) > 0)
+ while ((int) (nbytes= my_b_gets(&cache, (char*) buf, sizeof(buf))) > 0)
{
char *pos= buf+nbytes-1;
/* Remove end space and control characters */
@@ -251,10 +250,8 @@ exit2:
int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
{
char path[FN_REFLEN+16];
- MY_DIR *dirp;
long result=1;
int error = 0;
- register File file;
uint create_options = create_info ? create_info->options : 0;
DBUG_ENTER("mysql_alter_db");
@@ -602,7 +599,7 @@ bool mysql_change_db(THD *thd, const char *name)
int mysqld_show_create_db(THD *thd, const char *dbname)
{
- int length, db_length;
+ int length;
char path[FN_REFLEN], *to;
uint db_access;
bool found_libchar;
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index acf73f34d5d..16c45c8300e 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -210,7 +210,7 @@ private:
SELECT_LEX_UNIT - unit of selects (UNION, INTERSECT, ...) group
SELECT_LEXs
*/
-class st_lex;
+struct st_lex;
class st_select_lex;
class THD;
class select_result;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 7902e66043d..e096ef7869e 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1287,6 +1287,7 @@ mysql_execute_command(THD *thd)
int res= 0;
LEX *lex= &thd->lex;
TABLE_LIST *tables= (TABLE_LIST*) lex->select_lex.table_list.first;
+ TABLE_LIST *cursor;
SELECT_LEX *select_lex= &lex->select_lex;
SELECT_LEX_UNIT *unit= &lex->unit;
DBUG_ENTER("mysql_execute_command");
@@ -1343,7 +1344,7 @@ mysql_execute_command(THD *thd)
DBUG_VOID_RETURN;
}
//check rights
- for (TABLE_LIST *cursor= tables;
+ for (cursor= tables;
cursor;
cursor= cursor->next)
if (cursor->derived)
@@ -1361,7 +1362,7 @@ mysql_execute_command(THD *thd)
}
thd->send_explain_fields(explain_result);
// EXPLAIN derived tables
- for (TABLE_LIST *cursor= tables;
+ for (cursor= tables;
cursor;
cursor= cursor->next)
if (cursor->derived)
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index a085795fa76..bd115f0fc1e 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -634,7 +634,6 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
{
MEM_ROOT thd_root = thd->mem_root;
PREP_STMT stmt;
- bool error;
DBUG_ENTER("mysql_stmt_prepare");
bzero((char*) &stmt, sizeof(stmt));
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 09d41e2891b..801a3e556d5 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -171,7 +171,7 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
result->abort();
if (res || thd->net.report_error)
{
- send_error(thd, 0, MYF(0));
+ send_error(thd, 0, NullS);
res= 1;
}
delete result;
@@ -7176,7 +7176,6 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
bool distinct,const char *message)
{
List<Item> field_list;
- Item *item;
List<Item> item_list;
THD *thd=join->thd;
SELECT_LEX *select_lex = &(join->thd->lex.select_lex);
@@ -7190,7 +7189,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (message)
{
- item_list.push_back(new Item_int((int)thd->lex.select->select_number));
+ item_list.push_back(new Item_int((int32) thd->lex.select->select_number));
item_list.push_back(new Item_string(thd->lex.select->type,
strlen(thd->lex.select->type),
default_charset_info));
@@ -7217,7 +7216,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
tmp2.length(0);
item_list.empty();
- item_list.push_back(new Item_int((int)thd->lex.select->select_number));
+ item_list.push_back(new Item_int((int32) thd->lex.select->select_number));
item_list.push_back(new Item_string(thd->lex.select->type,
strlen(thd->lex.select->type),
default_charset_info));
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 827067c27d7..8c4c104d180 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -230,7 +230,7 @@ int mysqld_show_table_types(THD *thd)
const char *option_name= show_comp_option_name[(int) *types->value];
if (*types->value == SHOW_OPTION_YES &&
- !strcasecmp(default_type_name, types->type))
+ !my_strcasecmp(system_charset_info, default_type_name, types->type))
option_name= "DEFAULT";
net_store_data(packet, option_name);
net_store_data(packet, types->comment);
@@ -1398,7 +1398,6 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
int mysqld_show_charsets(THD *thd, const char *wild)
{
- uint i;
char buff[8192];
String packet2(buff,sizeof(buff),default_charset_info);
List<Item> field_list;
@@ -1425,7 +1424,7 @@ int mysqld_show_charsets(THD *thd, const char *wild)
net_store_data(&packet2,convert,cs->name);
net_store_data(&packet2,(uint32) cs->number);
net_store_data(&packet2,(uint32) cs->strxfrm_multiply);
- net_store_data(&packet2,(uint32) cs->mbmaxlen ? cs->mbmaxlen : 1);
+ net_store_data(&packet2,(uint32) (cs->mbmaxlen ? cs->mbmaxlen : 1));
if (my_net_write(&thd->net, (char*) packet2.ptr(),packet2.length()))
goto err;
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 1a18759eb5b..c2ef25ce6a1 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -111,7 +111,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result)
DBUG_ENTER("st_select_lex_unit::prepare");
this->thd= thd;
this->result= result;
- SELECT_LEX *lex_select_save= thd->lex.select;
+ SELECT_LEX *lex_select_save= thd->lex.select, *sl;
/* Global option */
if (((void*)(global_parameters)) == ((void*)this))
@@ -179,7 +179,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result)
// prepare selects
joins.empty();
- for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
+ for (sl= first_select(); sl; sl= sl->next_select())
{
JOIN *join= new JOIN(thd, sl->item_list,
sl->options | thd->options | SELECT_NO_UNLOCK |