summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2005-07-13 13:11:51 +0200
committerunknown <tomas@poseidon.ndb.mysql.com>2005-07-13 13:11:51 +0200
commit5fde853be884d593643ea8539f501afad9882181 (patch)
tree199ce8a04e25b10c9f6a328a570df1abbba0578f
parente5ca7155485483d6b9339f3c8197ba647ac1f1ef (diff)
parent9ea8a51178e5315957d862de2eed38df2afe9161 (diff)
downloadmariadb-git-5fde853be884d593643ea8539f501afad9882181.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1 BitKeeper/etc/config: Auto merged mysql-test/mysql-test-run.pl: Auto merged sql/item.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/slave.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged
-rw-r--r--VC++Files/tests/mysql_client_test.dsp4
-rw-r--r--include/my_global.h2
-rwxr-xr-xmysql-test/mysql-test-run.pl24
-rw-r--r--mysql-test/r/func_des_encrypt.result3
-rw-r--r--mysql-test/r/information_schema.result2
-rw-r--r--mysql-test/r/view.result29
-rw-r--r--mysql-test/t/func_des_encrypt.test9
-rw-r--r--mysql-test/t/view.test16
-rw-r--r--sql/des_key_file.cc18
-rw-r--r--sql/item.cc29
-rw-r--r--sql/item.h1
-rw-r--r--sql/item_strfunc.cc11
-rw-r--r--sql/log.cc3
-rw-r--r--sql/mysql_priv.h1
-rw-r--r--sql/net_serv.cc2
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_parse.cc7
-rw-r--r--sql/sql_view.cc1
-rw-r--r--tests/mysql_client_test.c18
-rw-r--r--vio/vio.c4
-rw-r--r--vio/viosocket.c4
-rw-r--r--zlib/inftrees.c2
22 files changed, 160 insertions, 32 deletions
diff --git a/VC++Files/tests/mysql_client_test.dsp b/VC++Files/tests/mysql_client_test.dsp
index b9d3916f398..7d821b45f2b 100644
--- a/VC++Files/tests/mysql_client_test.dsp
+++ b/VC++Files/tests/mysql_client_test.dsp
@@ -76,8 +76,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
!ENDIF
diff --git a/include/my_global.h b/include/my_global.h
index bb1ab71fa70..61850931a8e 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -830,7 +830,7 @@ typedef off_t os_off_t;
#define socket_errno WSAGetLastError()
#define SOCKET_EINTR WSAEINTR
#define SOCKET_EAGAIN WSAEINPROGRESS
-#define SOCKET_EWOULDBLOCK WSAEINPROGRESS
+#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
#define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE
#elif defined(OS2)
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 269cdb1340d..b70379d8597 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -287,6 +287,7 @@ sub executable_setup ();
sub environment_setup ();
sub kill_running_server ();
sub kill_and_cleanup ();
+sub ndbcluster_support ();
sub ndbcluster_install ();
sub ndbcluster_start ();
sub ndbcluster_stop ();
@@ -319,6 +320,12 @@ sub main () {
initial_setup();
command_line_setup();
executable_setup();
+
+ if (! $opt_skip_ndbcluster and ! $opt_with_ndbcluster)
+ {
+ $opt_with_ndbcluster= ndbcluster_support();
+ }
+
environment_setup();
signal_setup();
@@ -1026,6 +1033,23 @@ sub kill_and_cleanup () {
#
##############################################################################
+sub ndbcluster_support () {
+
+ # check ndbcluster support by testing using a switch
+ # that is only available in that case
+ if ( mtr_run($exe_mysqld,
+ ["--no-defaults",
+ "--ndb-use-exact-count",
+ "--help"],
+ "", "/dev/null", "/dev/null", "") != 0 )
+ {
+ mtr_report("No ndbcluster support");
+ return 0;
+ }
+ mtr_report("Has ndbcluster support");
+ return 1;
+}
+
# FIXME why is there a different start below?!
sub ndbcluster_install () {
diff --git a/mysql-test/r/func_des_encrypt.result b/mysql-test/r/func_des_encrypt.result
new file mode 100644
index 00000000000..46b30bdab58
--- /dev/null
+++ b/mysql-test/r/func_des_encrypt.result
@@ -0,0 +1,3 @@
+select des_encrypt('hello');
+des_encrypt('hello')
+€Ö2nV“Ø}
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index ffc5f5102a4..98f3d59485f 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -674,7 +674,7 @@ Database Table In_use Name_locked
mysql user 0 0
show status where variable_name like "%database%";
Variable_name Value
-Com_show_databases 0
+Com_show_databases 3
show variables where variable_name like "skip_show_databas";
Variable_name Value
show global status like "Threads_running";
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 3fd85cc883b..ef40a408932 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -149,13 +149,13 @@ v5 VIEW
v6 VIEW
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MyISAM 10 Fixed 5 9 45 2533274790395903 1024 0 NULL # # NULL latin1_swedish_ci NULL
-v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
-v2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
-v3 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
-v4 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
-v5 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
-v6 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
+t1 MyISAM 10 Fixed 5 9 45 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
+v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
+v2 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
+v3 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
+v4 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
+v5 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
+v6 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
drop view v1,v2,v3,v4,v5,v6;
create view v1 (c,d,e,f) as select a,b,
a in (select a+2 from t1), a = all (select a from t1) from t1;
@@ -1945,9 +1945,24 @@ ALTER VIEW v1 AS SELECT s1 AS s1, s2 AS s2 FROM t1;
CALL p1();
s1 s2
1 2
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1;
+CALL p1();
+s1 s2
+2 1
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
+create table t1 (f1 int, f2 int);
+create view v1 as select f1 as f3, f2 as f1 from t1;
+insert into t1 values (1,3),(2,1),(3,2);
+select * from v1 order by f1;
+f3 f1
+2 1
+3 2
+1 3
+drop view v1;
+drop table t1;
CREATE TABLE t1 (f1 char) ENGINE = innodb;
INSERT INTO t1 VALUES ('A');
CREATE VIEW v1 AS SELECT * FROM t1;
diff --git a/mysql-test/t/func_des_encrypt.test b/mysql-test/t/func_des_encrypt.test
new file mode 100644
index 00000000000..201a0051c58
--- /dev/null
+++ b/mysql-test/t/func_des_encrypt.test
@@ -0,0 +1,9 @@
+-- source include/have_openssl.inc
+
+# This test can't be in func_encrypt.test, because it requires
+# --des-key-file to not be set.
+
+#
+# Bug #11643: des_encrypt() causes server to die
+#
+select des_encrypt('hello');
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 2ccac059724..d296d5ebee5 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -83,8 +83,7 @@ explain extended select c from v6;
# show table/table status test
show tables;
show full tables;
---replace_column 12 # 13 #
---replace_result 2147483647 38654705663
+--replace_column 8 # 12 # 13 #
show table status;
drop view v1,v2,v3,v4,v5,v6;
@@ -1784,12 +1783,25 @@ CREATE PROCEDURE p1 () SELECT * FROM v1;
CALL p1();
ALTER VIEW v1 AS SELECT s1 AS s1, s2 AS s2 FROM t1;
CALL p1();
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1;
+CALL p1();
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
#
+# Test for bug #11709 View was ordered by wrong column
+#
+create table t1 (f1 int, f2 int);
+create view v1 as select f1 as f3, f2 as f1 from t1;
+insert into t1 values (1,3),(2,1),(3,2);
+select * from v1 order by f1;
+drop view v1;
+drop table t1;
+
+#
# Test for bug #11771: wrong query_id in SELECT * FROM <view>
#
diff --git a/sql/des_key_file.cc b/sql/des_key_file.cc
index a5a3e78d70f..34bcbd4fc4b 100644
--- a/sql/des_key_file.cc
+++ b/sql/des_key_file.cc
@@ -22,7 +22,17 @@
struct st_des_keyschedule des_keyschedule[10];
uint des_default_key;
pthread_mutex_t LOCK_des_key_file;
-static int initialized;
+static int initialized= 0;
+
+void
+init_des_key_file()
+{
+ if (!initialized)
+ {
+ initialized=1;
+ pthread_mutex_init(&LOCK_des_key_file,MY_MUTEX_INIT_FAST);
+ }
+}
/*
Function which loads DES keys from plaintext file into memory on MySQL
@@ -45,11 +55,7 @@ load_des_key_file(const char *file_name)
DBUG_ENTER("load_des_key_file");
DBUG_PRINT("enter",("name: %s",file_name));
- if (!initialized)
- {
- initialized=1;
- pthread_mutex_init(&LOCK_des_key_file,MY_MUTEX_INIT_FAST);
- }
+ init_des_key_file();
VOID(pthread_mutex_lock(&LOCK_des_key_file));
if ((file=my_open(file_name,O_RDONLY | O_BINARY ,MYF(MY_WME))) < 0 ||
diff --git a/sql/item.cc b/sql/item.cc
index c210ea3ca45..ff9d0496779 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -4504,6 +4504,35 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
return Item_direct_ref::fix_fields(thd, reference);
}
+/*
+ Compare view field's name with item's name before call to referenced
+ item's eq()
+
+ SYNOPSIS
+ Item_direct_view_ref::eq()
+ item item to compare with
+ binary_cmp make binary comparison
+
+ DESCRIPTION
+ Consider queries:
+ create view v1 as select t1.f1 as f2, t1.f2 as f1 from t1;
+ select * from v1 order by f1;
+ In order to choose right field for sorting we need to compare
+ given item's name (f1) to view field's name prior to calling
+ referenced item's eq().
+
+ RETURN
+ TRUE Referenced item is equal to given item
+ FALSE otherwise
+*/
+
+
+bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
+{
+ Item *it= ((Item *) item)->real_item();
+ return (!it->name || !my_strcasecmp(system_charset_info, it->name,
+ field_name)) && ref && (*ref)->real_item()->eq(it, binary_cmp);
+}
void Item_null_helper::print(String *str)
{
diff --git a/sql/item.h b/sql/item.h
index 12acb8dd28d..8a694a467ae 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1524,6 +1524,7 @@ public:
:Item_direct_ref(thd, item) {}
bool fix_fields(THD *, Item **);
+ bool eq(const Item *item, bool binary_cmp) const;
};
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index ccc56adf007..dcb539476a1 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -378,6 +378,9 @@ String *Item_func_des_encrypt::val_str(String *str)
if (arg_count == 1)
{
+ /* Make sure LOCK_des_key_file was initialized. */
+ init_des_key_file();
+
/* Protect against someone doing FLUSH DES_KEY_FILE */
VOID(pthread_mutex_lock(&LOCK_des_key_file));
keyschedule= des_keyschedule[key_number=des_default_key];
@@ -388,6 +391,10 @@ String *Item_func_des_encrypt::val_str(String *str)
key_number= (uint) args[1]->val_int();
if (key_number > 9)
goto error;
+
+ /* Make sure LOCK_des_key_file was initialized. */
+ init_des_key_file();
+
VOID(pthread_mutex_lock(&LOCK_des_key_file));
keyschedule= des_keyschedule[key_number];
VOID(pthread_mutex_unlock(&LOCK_des_key_file));
@@ -474,6 +481,10 @@ String *Item_func_des_decrypt::val_str(String *str)
// Check if automatic key and that we have privilege to uncompress using it
if (!(current_thd->master_access & SUPER_ACL) || key_number > 9)
goto error;
+
+ /* Make sure LOCK_des_key_file was initialized. */
+ init_des_key_file();
+
VOID(pthread_mutex_lock(&LOCK_des_key_file));
keyschedule= des_keyschedule[key_number];
VOID(pthread_mutex_unlock(&LOCK_des_key_file));
diff --git a/sql/log.cc b/sql/log.cc
index b1b558a1915..7d7ba90509d 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1155,6 +1155,9 @@ int MYSQL_LOG::purge_logs(const char *to_log,
*/
if (my_stat(log_info.log_file_name,&s,MYF(0)))
file_size= s.st_size;
+ else
+ sql_print_information("Failed to execute my_stat on file '%s'",
+ log_info.log_file_name);
}
/*
It's not fatal if we can't delete a log file ;
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index fc733fe74c1..9e4f9b5aef1 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -786,6 +786,7 @@ extern char *des_key_file;
extern struct st_des_keyschedule des_keyschedule[10];
extern uint des_default_key;
extern pthread_mutex_t LOCK_des_key_file;
+void init_des_key_file();
bool load_des_key_file(const char *file_name);
void free_des_key_file();
#endif /* HAVE_OPENSSL */
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 44539ec2d74..9f6295f8a36 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -135,7 +135,7 @@ my_bool my_net_init(NET *net, Vio* vio)
if (vio != 0) /* If real connection */
{
net->fd = vio_fd(vio); /* For perl DBI/DBD */
-#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__) && !defined(OS2)
+#if defined(MYSQL_SERVER) && !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
if (!(test_flags & TEST_BLOCKING))
{
my_bool old_mode;
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 46cc73d36cd..bfd4bd83a81 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1131,7 +1131,7 @@ int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
table_list= (table_list->belong_to_view ?
table_list->belong_to_view :
table_list);
- view= (bool)(table_list->view);
+ view= test(table_list->view);
}
if (view)
{
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 33db36ff255..6993f2e11fe 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2197,6 +2197,8 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
TABLE_LIST *table_list= (TABLE_LIST*) select_lex->table_list.first;
table_list->schema_select_lex= sel;
table_list->schema_table_reformed= 1;
+ statistic_increment(thd->status_var.com_stat[lex->orig_sql_command],
+ &LOCK_status);
DBUG_RETURN(0);
}
@@ -2369,9 +2371,10 @@ mysql_execute_command(THD *thd)
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
DBUG_RETURN(-1);
}
+ if(lex->orig_sql_command == SQLCOM_END)
+ statistic_increment(thd->status_var.com_stat[lex->sql_command],
+ &LOCK_status);
- statistic_increment(thd->status_var.com_stat[lex->sql_command],
- &LOCK_status);
switch (lex->sql_command) {
case SQLCOM_SELECT:
{
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index d74b96de2cd..a60bf80a6d8 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1004,6 +1004,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
if (my_delete(path, MYF(MY_WME)))
goto err;
query_cache_invalidate3(thd, view, 0);
+ sp_cache_invalidate();
VOID(pthread_mutex_unlock(&LOCK_open));
}
send_ok(thd);
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index b237387ef35..ffb848a6ef2 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -173,6 +173,14 @@ DIE_UNLESS(stmt == 0);\
#define mytest_r(x) if (x) {myerror(NULL);DIE_UNLESS(FALSE);}
+/* A workaround for Sun Forte 5.6 on Solaris x86 */
+
+static int cmp_double(double *a, double *b)
+{
+ return *a == *b;
+}
+
+
/* Print the error message */
static void print_error(const char *msg)
@@ -1645,7 +1653,7 @@ static void test_prepare()
DIE_UNLESS(real_data == o_real_data);
DIE_UNLESS(length[5] == 4);
- DIE_UNLESS(double_data == o_double_data);
+ DIE_UNLESS(cmp_double(&double_data, &o_double_data));
DIE_UNLESS(length[6] == 8);
DIE_UNLESS(strcmp(data, str_data) == 0);
@@ -9858,7 +9866,7 @@ static void test_bug3035()
uint32 uint32_val;
longlong int64_val;
ulonglong uint64_val;
- double double_val, udouble_val;
+ double double_val, udouble_val, double_tmp;
char longlong_as_string[22], ulonglong_as_string[22];
/* mins and maxes */
@@ -10005,7 +10013,8 @@ static void test_bug3035()
DIE_UNLESS(int64_val == int64_min);
DIE_UNLESS(uint64_val == uint64_min);
DIE_UNLESS(double_val == (longlong) uint64_min);
- DIE_UNLESS(udouble_val == ulonglong2double(uint64_val));
+ double_tmp= ulonglong2double(uint64_val);
+ DIE_UNLESS(cmp_double(&udouble_val, &double_tmp));
DIE_UNLESS(!strcmp(longlong_as_string, "0"));
DIE_UNLESS(!strcmp(ulonglong_as_string, "0"));
@@ -10029,7 +10038,8 @@ static void test_bug3035()
DIE_UNLESS(int64_val == int64_max);
DIE_UNLESS(uint64_val == uint64_max);
DIE_UNLESS(double_val == (longlong) uint64_val);
- DIE_UNLESS(udouble_val == ulonglong2double(uint64_val));
+ double_tmp= ulonglong2double(uint64_val);
+ DIE_UNLESS(cmp_double(&udouble_val, &double_tmp));
DIE_UNLESS(!strcmp(longlong_as_string, "-1"));
DIE_UNLESS(!strcmp(ulonglong_as_string, "18446744073709551615"));
diff --git a/vio/vio.c b/vio/vio.c
index 6227493b994..bcf0ac032c8 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -143,7 +143,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags)
sprintf(vio->desc,
(vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
vio->sd);
-#if !defined(___WIN__) && !defined(__EMX__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
#if !defined(NO_FCNTL_NONBLOCK)
#if defined(__FreeBSD__)
fcntl(sd, F_SETFL, vio->fcntl_mode); /* Yahoo! FreeBSD patch */
@@ -158,7 +158,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags)
{
/* set to blocking mode by default */
ulong arg=0, r;
- r = ioctlsocket(sd,FIONBIO,(void*) &arg, sizeof(arg));
+ r = ioctlsocket(sd,FIONBIO,(void*) &arg);
vio->fcntl_mode &= ~O_NONBLOCK;
}
#endif
diff --git a/vio/viosocket.c b/vio/viosocket.c
index c9df242b5c4..3b4013f4089 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -128,7 +128,7 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode,
DBUG_PRINT("enter", ("set_blocking_mode: %d old_mode: %d",
(int) set_blocking_mode, (int) *old_mode));
-#if !defined(___WIN__) && !defined(__EMX__)
+#if !defined(__WIN__) && !defined(__EMX__)
#if !defined(NO_FCNTL_NONBLOCK)
if (vio->sd >= 0)
{
@@ -161,7 +161,7 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode,
vio->fcntl_mode |= O_NONBLOCK; /* set bit */
}
if (old_fcntl != vio->fcntl_mode)
- r = ioctlsocket(vio->sd,FIONBIO,(void*) &arg, sizeof(arg));
+ r = ioctlsocket(vio->sd,FIONBIO,(void*) &arg);
}
#ifndef __EMX__
else
diff --git a/zlib/inftrees.c b/zlib/inftrees.c
index 8a896b28793..509461d9273 100644
--- a/zlib/inftrees.c
+++ b/zlib/inftrees.c
@@ -134,7 +134,7 @@ unsigned short FAR *work;
left -= count[len];
if (left < 0) return -1; /* over-subscribed */
}
- if (left > 0 && (type == CODES || (codes - count[0] != 1)))
+ if (left > 0 && (type == CODES || max != 1))
return -1; /* incomplete set */
/* generate offsets into symbol table for each length for sorting */