summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/select.result55
-rw-r--r--mysql-test/t/select.test39
-rwxr-xr-xnetware/BUILD/mwenv4
-rw-r--r--netware/pack_isam.def1
-rw-r--r--scripts/make_binary_distribution.sh3
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/sql_show.cc12
-rw-r--r--strings/my_strtoll10.c9
8 files changed, 117 insertions, 8 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index df0dd3af616..be46d180f2d 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2643,3 +2643,58 @@ select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null);
f1 f2 f3
2 NULL 2
drop table t1,t2;
+create table t1 (f1 int not null auto_increment primary key, f2 varchar(10));
+create table t11 like t1;
+insert into t1 values(1,""),(2,"");
+show table status like 't1%';
+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 9 Dynamic 2 20 X X X X X X X X latin1_swedish_ci NULL
+t11 MyISAM 9 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL
+select 123 as a from t1 where f1 is null;
+a
+drop table t1,t11;
+CREATE TABLE t1 (a INT, b INT);
+(SELECT a, b AS c FROM t1) ORDER BY c+1;
+a c
+(SELECT a, b AS c FROM t1) ORDER BY b+1;
+a c
+SELECT a, b AS c FROM t1 ORDER BY c+1;
+a c
+SELECT a, b AS c FROM t1 ORDER BY b+1;
+a c
+drop table t1;
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) );
+INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4);
+CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT );
+INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),
+(1,2,3);
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
+a b c d
+1 2 1 1
+1 2 2 1
+1 2 3 1
+1 10 2
+1 11 2
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c;
+a b c d
+1 10 4
+1 2 1 1
+1 2 2 1
+1 2 3 1
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c;
+a b c d
+1 2 1 1
+1 2 2 1
+1 2 3 1
+1 10 2
+1 11 2
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1
+WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
+a b c d
+1 2 1 1
+1 2 2 1
+1 2 3 1
+DROP TABLE IF EXISTS t1, t2;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 7dc017d149f..56fab52729e 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2189,4 +2189,43 @@ select * from t1,t2 where f1=f3 and (f1,f2) = (2,null);
select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null);
drop table t1,t2;
+#
+# Bug #13535
+#
+create table t1 (f1 int not null auto_increment primary key, f2 varchar(10));
+create table t11 like t1;
+insert into t1 values(1,""),(2,"");
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
+show table status like 't1%';
+select 123 as a from t1 where f1 is null;
+drop table t1,t11;
+
+# Bug 7672 Unknown column error in order clause
+#
+CREATE TABLE t1 (a INT, b INT);
+(SELECT a, b AS c FROM t1) ORDER BY c+1;
+(SELECT a, b AS c FROM t1) ORDER BY b+1;
+SELECT a, b AS c FROM t1 ORDER BY c+1;
+SELECT a, b AS c FROM t1 ORDER BY b+1;
+drop table t1;
+
+#
+# Bug #3874 (function in GROUP and LEFT JOIN)
+#
+
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) );
+INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4);
+CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT );
+INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),
+ (1,2,3);
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c;
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c;
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1
+WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
+DROP TABLE IF EXISTS t1, t2;
+
# End of 4.1 tests
diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv
index 0acfd3aaf8f..0b3fa9beb6a 100755
--- a/netware/BUILD/mwenv
+++ b/netware/BUILD/mwenv
@@ -19,9 +19,9 @@ export AR='mwldnlm'
export AR_FLAGS='-type library -o'
export AS='mwasmnlm'
export CC='mwccnlm -gccincludes'
-export CFLAGS='-O3 -align 8 -proc 686 -relax_pointers -dialect c'
+export CFLAGS='-align 8 -proc 686 -relax_pointers -dialect c'
export CXX='mwccnlm -gccincludes'
-export CXXFLAGS='-O3 -align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T'
+export CXXFLAGS='-align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T'
export LD='mwldnlm'
export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -map -flags pseudopreemption'
export RANLIB=:
diff --git a/netware/pack_isam.def b/netware/pack_isam.def
index b93cfdffbeb..fff74806f39 100644
--- a/netware/pack_isam.def
+++ b/netware/pack_isam.def
@@ -4,6 +4,7 @@
MODULE libc.nlm
COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL ISAM Table Pack Tool"
+SCREENNAME "MySQL ISAM Table Pack Tool"
VERSION 4, 0
XDCDATA ../netware/mysql.xdc
#DEBUG
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index d622dfed9d3..c00ba1c6f57 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -254,8 +254,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then
>> $BASE/bin/init_db.sql
sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \
> $BASE/bin/test_db.sql
-# cp ./netware/static_init_db.sql ./netware/init_db.sql
-# ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql
+ ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql
fi
#
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index f72d897e22d..c485d6cd04e 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -4135,7 +4135,7 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab)
tab->cached_eq_ref_table=1;
if (tab->type == JT_CONST) // We can skip const tables
return (tab->eq_ref_table=1); /* purecov: inspected */
- if (tab->type != JT_EQ_REF)
+ if (tab->type != JT_EQ_REF || tab->table->maybe_null)
return (tab->eq_ref_table=0); // We must use this
Item **ref_item=tab->ref.items;
Item **end=ref_item+tab->ref.key_parts;
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index e619b148f3a..d6ceca5f23c 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -462,6 +462,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
TABLE *table;
Protocol *protocol= thd->protocol;
TIME time;
+ int res= 0;
DBUG_ENTER("mysqld_extend_show_tables");
(void) sprintf(path,"%s/%s",mysql_data_home,db);
@@ -632,10 +633,15 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
close_thread_tables(thd,0);
}
if (protocol->write())
- DBUG_RETURN(-1);
+ {
+ res= -1;
+ break;
+ }
}
- send_eof(thd);
- DBUG_RETURN(0);
+ thd->insert_id(0);
+ if (!res)
+ send_eof(thd);
+ DBUG_RETURN(res);
}
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index 5217564087c..9cfb11524c1 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -19,7 +19,16 @@
#include <m_string.h>
#undef ULONGLONG_MAX
+/*
+ Needed under MetroWerks Compiler, since MetroWerks compiler does not
+ properly handle a constant expression containing a mod operator
+*/
+#if defined(__NETWARE__) && defined(__MWERKS__)
+static ulonglong ulonglong_max= ~(ulonglong) 0;
+#define ULONGLONG_MAX ulonglong_max
+#else
#define ULONGLONG_MAX (~(ulonglong) 0)
+#endif /* __NETWARE__ && __MWERKS__ */
#define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000))
#define INIT_CNT 9
#define LFACTOR ULL(1000000000)