summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore2
-rw-r--r--Makefile.am1
-rw-r--r--include/my_global.h8
-rw-r--r--innobase/page/page0cur.c2
-rw-r--r--mysql-test/r/distinct.result2
-rw-r--r--mysql-test/r/func_group.result4
-rw-r--r--mysql-test/r/innodb.result2
-rw-r--r--mysql-test/r/join.result30
-rw-r--r--mysql-test/r/order_by.result12
-rw-r--r--mysql-test/r/show_check.result56
-rw-r--r--mysql-test/t/func_group.test2
-rw-r--r--mysql-test/t/innodb.test2
-rw-r--r--mysql-test/t/join.test26
-rw-r--r--mysql-test/t/order_by.test3
-rw-r--r--mysql-test/t/show_check.test35
-rw-r--r--netware/isamchk.def10
-rw-r--r--netware/isamlog.def9
-rw-r--r--netware/libmysql.def10
-rw-r--r--netware/libmysqld.def65
-rw-r--r--netware/my_print_defaults.def9
-rw-r--r--netware/myisamchk.def10
-rw-r--r--netware/myisamlog.def9
-rw-r--r--netware/myisampack.def9
-rw-r--r--netware/mysql.def11
-rw-r--r--netware/mysql_install.def9
-rw-r--r--netware/mysql_install_db.def10
-rw-r--r--netware/mysql_test_run.def10
-rw-r--r--netware/mysqladmin.def10
-rw-r--r--netware/mysqlbinlog.def9
-rw-r--r--netware/mysqlcheck.def9
-rw-r--r--netware/mysqld.def12
-rw-r--r--netware/mysqld_safe.def10
-rw-r--r--netware/mysqldump.def9
-rw-r--r--netware/mysqlimport.def9
-rw-r--r--netware/mysqlshow.def10
-rw-r--r--netware/mysqltest.def9
-rw-r--r--netware/overlay.tar.gzbin2334 -> 0 bytes
-rw-r--r--netware/pack_isam.def9
-rw-r--r--netware/perror.def9
-rw-r--r--netware/replace.def9
-rw-r--r--netware/resolveip.def9
-rw-r--r--sql/filesort.cc5
-rw-r--r--sql/ha_innodb.cc27
-rw-r--r--sql/lex.h1
-rw-r--r--sql/opt_range.cc5
-rw-r--r--sql/opt_range.h2
-rw-r--r--sql/sql_select.cc5
-rw-r--r--sql/sql_yacc.yy39
48 files changed, 533 insertions, 32 deletions
diff --git a/.bzrignore b/.bzrignore
index 7aee59588ce..60212fc1976 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -594,3 +594,5 @@ cmd-line-utils/libedit/common.h
stamp-h2
stamp-h3
stamp-h4
+support-files/MacOSX/Description.plist
+support-files/MacOSX/Info.plist
diff --git a/Makefile.am b/Makefile.am
index ea965e282f3..fc3cc23cf69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -88,4 +88,3 @@ tags:
test:
cd mysql-test ; ./mysql-test-run
-
diff --git a/include/my_global.h b/include/my_global.h
index 0b423655281..f7b97d96545 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -769,6 +769,14 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define INT32(v) (int32) (v)
#define MYF(v) (myf) (v)
+#ifndef LL
+#ifdef HAVE_LONG_LONG
+#define LL(A) A ## LL
+#else
+#define LL(A) A ## L
+#endif
+#endif
+
/*
Defines to make it possible to prioritize register assignments. No
longer that important with modern compilers.
diff --git a/innobase/page/page0cur.c b/innobase/page/page0cur.c
index 1ea6e3e3018..2042db80529 100644
--- a/innobase/page/page0cur.c
+++ b/innobase/page/page0cur.c
@@ -301,7 +301,7 @@ page_cur_search_with_match(
/* This means current dfield is not SQL
NULL, and the current rec field extends it */
- low = mid;
+ low_rec = mid_rec;
low_matched_fields = cur_matched_fields;
low_matched_bytes = cur_matched_bytes;
} else {
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index ae1d9588bc7..1f459faa8f4 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -77,7 +77,6 @@ NULL NULL
10 VMT
select id+0 as a,max(id),concat(facility) as b from t1 group by a order by b desc,a;
a max(id) b
-NULL NULL NULL
10 10 VMT
9 9 SRV
8 8 RV
@@ -90,6 +89,7 @@ NULL NULL NULL
1 1 /L
-1 -1
0 0
+NULL NULL NULL
select id >= 0 and id <= 5 as grp,count(*) from t1 group by grp;
grp count(*)
NULL 1
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index ba48808a319..d6bfa9387fd 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -42,8 +42,8 @@ insert into t1 values (null,null,'');
select count(distinct a),count(distinct grp) from t1;
count(distinct a) count(distinct grp)
6 3
-select sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1;
-sum(a) count(a) avg(a) std(a) variance(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c)
+select sum(all a),count(all a),avg(all a),std(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1;
+sum(all a) count(all a) avg(all a) std(all a) bit_or(all a) bit_and(all a) min(all a) max(all a) min(all c) max(all c)
21 6 3.5000 1.7078 2.9167 7 0 1 6 E
select grp, sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp;
grp sum(a) count(a) avg(a) std(a) variance(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c)
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index f5bbf082730..9ea2ea0f87c 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -290,7 +290,7 @@ select * from t1;
id val
drop table t1;
create table t1 (a integer) type=innodb;
-begin;
+start transaction;
rename table t1 to t2;
create table t1 (b integer) type=innodb;
insert into t1 values (1);
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 6649c480d7b..274a4dec85d 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -1,4 +1,34 @@
drop table if exists t1,t2,t3;
+CREATE TABLE t1 (S1 INT);
+CREATE TABLE t2 (S1 INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 JOIN t2;
+S1 S1
+1 2
+SELECT * FROM t1 INNER JOIN t2;
+S1 S1
+1 2
+SELECT * from t1 JOIN t2 USING (S1);
+S1 S1
+SELECT * FROM t1 INNER JOIN t2 USING (S1);
+S1 S1
+SELECT * from t1 CROSS JOIN t2;
+S1 S1
+1 2
+SELECT * from t1 LEFT JOIN t2 USING(S1);
+S1 S1
+1 NULL
+SELECT * from t1 LEFT JOIN t2 ON(t2.S1=2);
+S1 S1
+1 2
+SELECT * from t1 RIGHT JOIN t2 USING(S1);
+S1 S1
+NULL 2
+SELECT * from t1 RIGHT JOIN t2 ON(t1.S1=1);
+S1 S1
+1 2
+drop table t1,t2;
create table t1 (id int primary key);
create table t2 (id int);
insert into t1 values (75);
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 9bacae92945..5654ab32a44 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -303,7 +303,7 @@ a b c
1 NULL b
explain select * from t1 where a >= 1 and a < 3 and b >0 order by a desc,b desc;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 9 NULL 8 Using where; Using index; Using filesort
+1 SIMPLE t1 range a a 9 NULL 8 Using where; Using index
explain select * from t1 where a = 2 and b >0 order by a desc,b desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 9 NULL 5 Using where; Using index
@@ -319,7 +319,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 9 NULL 5 Using where; Using index
explain select * from t1 where a = 2 and b < 2 order by a desc,b desc;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 9 NULL 2 Using where; Using index; Using filesort
+1 SIMPLE t1 range a a 9 NULL 2 Using where; Using index;
+select * from t1 where a = 1 order by b desc;
+a b c
+1 3 b
+1 1 b
+1 1 b
+1 1 NULL
+1 NULL b
+1 NULL NULL
alter table t1 modify b int not null, modify c varchar(10) not null;
explain select * from t1 order by a, b, c;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index d2bdc4f9401..66bd319c048 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -171,6 +171,62 @@ f double(5,0) binary YES NULL select,insert,update,references
h float(3,2) binary YES NULL select,insert,update,references
i float(3,0) binary YES NULL select,insert,update,references
drop table t1;
+create table t1 (
+type_bool bool not null,
+type_tiny tinyint not null auto_increment primary key,
+type_short smallint(3),
+type_mediumint mediumint,
+type_bigint bigint,
+type_decimal decimal(5,2),
+type_numeric numeric(5,2),
+empty_char char(0),
+type_char char(2),
+type_varchar varchar(10),
+type_timestamp timestamp not null,
+type_date date not null,
+type_time time not null,
+type_datetime datetime not null,
+type_year year,
+type_enum enum ('red', 'green', 'blue'),
+type_set enum ('red', 'green', 'blue'),
+type_tinyblob tinyblob,
+type_blob blob,
+type_medium_blob mediumblob,
+type_long_blob longblob,
+index(type_short)
+) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `type_bool` tinyint(1) NOT NULL default '0',
+ `type_tiny` tinyint(4) NOT NULL auto_increment,
+ `type_short` smallint(3) default NULL,
+ `type_mediumint` mediumint(9) default NULL,
+ `type_bigint` bigint(20) default NULL,
+ `type_decimal` decimal(5,2) default NULL,
+ `type_numeric` decimal(5,2) default NULL,
+ `empty_char` char(0) default NULL,
+ `type_char` char(2) default NULL,
+ `type_varchar` varchar(10) default NULL,
+ `type_timestamp` timestamp(14) NOT NULL,
+ `type_date` date NOT NULL default '0000-00-00',
+ `type_time` time NOT NULL default '00:00:00',
+ `type_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
+ `type_year` year(4) default NULL,
+ `type_enum` enum('red','green','blue') default NULL,
+ `type_set` enum('red','green','blue') default NULL,
+ `type_tinyblob` tinyblob,
+ `type_blob` blob,
+ `type_medium_blob` mediumblob,
+ `type_long_blob` longblob,
+ PRIMARY KEY (`type_tiny`),
+ KEY `type_short` (`type_short`)
+) TYPE=MyISAM MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
+insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
+select * from t1;
+type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob
+0 1 NULL NULL NULL NULL NULL NULL NULL NULL 20030207100001 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL NULL NULL NULL NULL NULL
+drop table t1;
create table t1 (c decimal, d double, f float, r real);
show columns from t1;
Field Type Collation Null Key Default Extra
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index fe1cebaac17..fc3b089ece1 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -24,7 +24,7 @@ select count(distinct a),count(distinct grp) from t1;
insert into t1 values (null,null,'');
select count(distinct a),count(distinct grp) from t1;
-select sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1;
+select sum(all a),count(all a),avg(all a),std(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1;
select grp, sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp;
select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index e875bf883c7..f3bf1b21824 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -170,7 +170,7 @@ drop table t1;
#
create table t1 (a integer) type=innodb;
-begin;
+start transaction;
rename table t1 to t2;
create table t1 (b integer) type=innodb;
insert into t1 values (1);
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index 2a3b8488ca0..59c0c37e40d 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -1,10 +1,32 @@
#
-# This failed for lia Perminov
-#
+# Initialization
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
+#
+# Test different join syntaxes
+#
+
+CREATE TABLE t1 (S1 INT);
+CREATE TABLE t2 (S1 INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 JOIN t2;
+SELECT * FROM t1 INNER JOIN t2;
+SELECT * from t1 JOIN t2 USING (S1);
+SELECT * FROM t1 INNER JOIN t2 USING (S1);
+SELECT * from t1 CROSS JOIN t2;
+SELECT * from t1 LEFT JOIN t2 USING(S1);
+SELECT * from t1 LEFT JOIN t2 ON(t2.S1=2);
+SELECT * from t1 RIGHT JOIN t2 USING(S1);
+SELECT * from t1 RIGHT JOIN t2 ON(t1.S1=1);
+drop table t1,t2;
+
+#
+# This failed for lia Perminov
+#
+
create table t1 (id int primary key);
create table t2 (id int);
insert into t1 values (75);
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index c6bc7e9f868..f7677709ca4 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -228,7 +228,8 @@ explain select * from t1 where a = 2 and (b is null or b > 0) order by a
desc,b desc;
explain select * from t1 where a = 2 and b > 0 order by a desc,b desc;
explain select * from t1 where a = 2 and b < 2 order by a desc,b desc;
-
+explain select * from t1 where a = 1 order by b desc;
+select * from t1 where a = 1 order by b desc;
#
# Test things when we don't have NULL keys
#
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index a21436637d1..f6f0ac0b82b 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -86,6 +86,41 @@ show columns from t1;
show full columns from t1;
drop table t1;
+#
+# Do a create table that tries to cover all types and options
+#
+create table t1 (
+type_bool bool not null,
+type_tiny tinyint not null auto_increment primary key,
+type_short smallint(3),
+type_mediumint mediumint,
+type_bigint bigint,
+type_decimal decimal(5,2),
+type_numeric numeric(5,2),
+empty_char char(0),
+type_char char(2),
+type_varchar varchar(10),
+type_timestamp timestamp not null,
+type_date date not null,
+type_time time not null,
+type_datetime datetime not null,
+type_year year,
+type_enum enum ('red', 'green', 'blue'),
+type_set enum ('red', 'green', 'blue'),
+type_tinyblob tinyblob,
+type_blob blob,
+type_medium_blob mediumblob,
+type_long_blob longblob,
+index(type_short)
+) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
+
+# Not tested above: RAID_# UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY
+show create table t1;
+insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
+select * from t1;
+drop table t1;
+
+
# Check auto conversions of types
create table t1 (c decimal, d double, f float, r real);
diff --git a/netware/isamchk.def b/netware/isamchk.def
new file mode 100644
index 00000000000..4ac6c6781c7
--- /dev/null
+++ b/netware/isamchk.def
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# ISAM Check
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL ISAM Table Check Tool"
+VERSION 4, 0
+STACKSIZE 65536
+#DEBUG
+
diff --git a/netware/isamlog.def b/netware/isamlog.def
new file mode 100644
index 00000000000..e87dafc6cb5
--- /dev/null
+++ b/netware/isamlog.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# ISAM Log
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "ISAM Log"
+VERSION 4, 0
+DEBUG
+
diff --git a/netware/libmysql.def b/netware/libmysql.def
new file mode 100644
index 00000000000..f995eb8a496
--- /dev/null
+++ b/netware/libmysql.def
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# MySQL Client
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+EXPORT @libmysql.imp
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Client Library"
+VERSION 4, 0
+AUTOUNLOAD
+#DEBUG
diff --git a/netware/libmysqld.def b/netware/libmysqld.def
new file mode 100644
index 00000000000..c6615ee971c
--- /dev/null
+++ b/netware/libmysqld.def
@@ -0,0 +1,65 @@
+LIBRARY LIBMYSQLD
+DESCRIPTION 'MySQL 4.0 Embedded Server Library'
+VERSION 4.0
+EXPORTS
+ mysql_server_end
+ mysql_server_init
+ mysql_use_result
+ mysql_thread_safe
+ mysql_thread_id
+ mysql_store_result
+ mysql_stat
+ mysql_shutdown
+ mysql_select_db
+ mysql_row_tell
+ mysql_row_seek
+ mysql_real_query
+ mysql_real_connect
+ mysql_query
+ mysql_ping
+ mysql_options
+ mysql_num_rows
+ mysql_num_fields
+ mysql_list_tables
+ mysql_list_processes
+ mysql_list_fields
+ mysql_list_dbs
+ mysql_kill
+ mysql_insert_id
+ mysql_init
+ mysql_info
+ mysql_get_server_info
+ mysql_get_proto_info
+ mysql_get_host_info
+ mysql_get_client_info
+ mysql_free_result
+ mysql_field_tell
+ mysql_field_count
+ mysql_field_seek
+ mysql_fetch_row
+ mysql_fetch_lengths
+ mysql_fetch_fields
+ mysql_fetch_field_direct
+ mysql_fetch_field
+ mysql_escape_string
+ mysql_real_escape_string
+ mysql_error
+ mysql_errno
+ mysql_eof
+ mysql_dump_debug_info
+ mysql_drop_db
+ mysql_debug
+ mysql_data_seek
+ mysql_create_db
+ mysql_character_set_name
+ mysql_change_user
+ mysql_connect
+ mysql_close
+ mysql_affected_rows
+ mysql_thread_init
+ mysql_thread_end
+ mysql_send_query
+ mysql_read_query_result
+ mysql_refresh
+ mysql_odbc_escape_string
+ myodbc_remove_escape
diff --git a/netware/my_print_defaults.def b/netware/my_print_defaults.def
new file mode 100644
index 00000000000..384b705bead
--- /dev/null
+++ b/netware/my_print_defaults.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# My Print Defaults
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Print Defaults Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/myisamchk.def b/netware/myisamchk.def
new file mode 100644
index 00000000000..b9de47facc3
--- /dev/null
+++ b/netware/myisamchk.def
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# MyISAM Check
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL MyISAM Table Check Tool"
+VERSION 4, 0
+STACKSIZE 65536
+#DEBUG
+
diff --git a/netware/myisamlog.def b/netware/myisamlog.def
new file mode 100644
index 00000000000..f2b42757b34
--- /dev/null
+++ b/netware/myisamlog.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# MyISAM Log
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL MyISAM Table Log Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/myisampack.def b/netware/myisampack.def
new file mode 100644
index 00000000000..ada7c869243
--- /dev/null
+++ b/netware/myisampack.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# MyISAM Pack
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL MyISAM Table Pack Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysql.def b/netware/mysql.def
new file mode 100644
index 00000000000..3947252a097
--- /dev/null
+++ b/netware/mysql.def
@@ -0,0 +1,11 @@
+#------------------------------------------------------------------------------
+# MySQL Client
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+SCREENNAME "MySQL Monitor"
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Monitor"
+VERSION 4, 0
+MULTIPLE
+#DEBUG
+
diff --git a/netware/mysql_install.def b/netware/mysql_install.def
new file mode 100644
index 00000000000..2c2819ec6af
--- /dev/null
+++ b/netware/mysql_install.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# My Print Defaults
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Install Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysql_install_db.def b/netware/mysql_install_db.def
new file mode 100644
index 00000000000..448e5a44635
--- /dev/null
+++ b/netware/mysql_install_db.def
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# MySQL Install DB
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+SCREENNAME "MySQL Install"
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Initial Database Installer"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysql_test_run.def b/netware/mysql_test_run.def
new file mode 100644
index 00000000000..b30139e5526
--- /dev/null
+++ b/netware/mysql_test_run.def
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# MySQL Test Run
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+STACKSIZE 65536
+SCREENNAME "MySQL Test Run"
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Test Run"
+VERSION 4, 0
+#DEBUG
diff --git a/netware/mysqladmin.def b/netware/mysqladmin.def
new file mode 100644
index 00000000000..750d2231888
--- /dev/null
+++ b/netware/mysqladmin.def
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# MySQL Admin
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+SCREENNAME "MySQL Admin"
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Admin Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysqlbinlog.def b/netware/mysqlbinlog.def
new file mode 100644
index 00000000000..a5ed40bf7fc
--- /dev/null
+++ b/netware/mysqlbinlog.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# MySQL Binary Log
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Binary Log Dump Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysqlcheck.def b/netware/mysqlcheck.def
new file mode 100644
index 00000000000..98029cab416
--- /dev/null
+++ b/netware/mysqlcheck.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# MySQL Client
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Check Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysqld.def b/netware/mysqld.def
new file mode 100644
index 00000000000..d2ee41955ba
--- /dev/null
+++ b/netware/mysqld.def
@@ -0,0 +1,12 @@
+#------------------------------------------------------------------------------
+# MySQL Server
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+XDCDATA mysqld.xdc
+COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Database Server"
+VERSION 4, 0
+MULTIPLE
+STACKSIZE 65536
+#DEBUG
+
diff --git a/netware/mysqld_safe.def b/netware/mysqld_safe.def
new file mode 100644
index 00000000000..36a8c1cd89e
--- /dev/null
+++ b/netware/mysqld_safe.def
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# MySQLd Safe
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+SCREENNAME "MySQL Database Server"
+COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Database Server Monitor"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysqldump.def b/netware/mysqldump.def
new file mode 100644
index 00000000000..2de489762b2
--- /dev/null
+++ b/netware/mysqldump.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# MySQL Admin
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Dump Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysqlimport.def b/netware/mysqlimport.def
new file mode 100644
index 00000000000..35673c94391
--- /dev/null
+++ b/netware/mysqlimport.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# MySQL Client
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Import Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysqlshow.def b/netware/mysqlshow.def
new file mode 100644
index 00000000000..2629ae38974
--- /dev/null
+++ b/netware/mysqlshow.def
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# MySQL Show
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+SCREENNAME "MySQL Show"
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Show Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/mysqltest.def b/netware/mysqltest.def
new file mode 100644
index 00000000000..3f6bc631244
--- /dev/null
+++ b/netware/mysqltest.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# MySQL Admin
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Test Case Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/overlay.tar.gz b/netware/overlay.tar.gz
deleted file mode 100644
index bff2118b458..00000000000
--- a/netware/overlay.tar.gz
+++ /dev/null
Binary files differ
diff --git a/netware/pack_isam.def b/netware/pack_isam.def
new file mode 100644
index 00000000000..f22eb13da39
--- /dev/null
+++ b/netware/pack_isam.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# Pack ISAM
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "Pack ISAM"
+VERSION 4, 0
+DEBUG
+
diff --git a/netware/perror.def b/netware/perror.def
new file mode 100644
index 00000000000..8c604b2b92b
--- /dev/null
+++ b/netware/perror.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# PERROR
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Error Code Description Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/replace.def b/netware/replace.def
new file mode 100644
index 00000000000..1e6955d3939
--- /dev/null
+++ b/netware/replace.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# Replace
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Text Replacement Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/netware/resolveip.def b/netware/resolveip.def
new file mode 100644
index 00000000000..f09a5bb915b
--- /dev/null
+++ b/netware/resolveip.def
@@ -0,0 +1,9 @@
+#------------------------------------------------------------------------------
+# Resolve IP
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL IP/Hostname Resolve Tool"
+VERSION 4, 0
+#DEBUG
+
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 27c4b962515..8bf9c648e82 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -450,7 +450,10 @@ static void make_sortkey(register SORTPARAM *param,
{
if (field->is_null())
{
- bzero((char*) to,sort_field->length+1);
+ if (sort_field->reverse)
+ bfill(to,sort_field->length+1,(char) 255);
+ else
+ bzero((char*) to,sort_field->length+1);
to+= sort_field->length+1;
continue;
}
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 12aa7c0b6f5..23c6082da92 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2292,7 +2292,18 @@ convert_search_mode_to_innobase(
case HA_READ_AFTER_KEY: return(PAGE_CUR_G);
case HA_READ_BEFORE_KEY: return(PAGE_CUR_L);
case HA_READ_PREFIX: return(PAGE_CUR_GE);
- case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE_OR_EXTENDS);
+ case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE);
+ /* TODO: 1) this should really be
+ return(PAGE_CUR_LE_OR_EXTENDS); but since MySQL uses
+ a wrong flag in search, we convert this to PAGE_CUR_LE;
+ 2) if the character set is not latin1, then InnoDB
+ uses a MySQL function innobase_mysql_cmp() to
+ compare CHAR and VARCHAR strings; since that function
+ does not return the number of matched bytes,
+ PAGE_CUR_LE_OR_EXTENDS does not currently work: we
+ should probably write my_sortncmp_with_n_matcehd_bytes()
+ to determine if a field 'extends' another;
+ see dev-public discussion on Feb 7th, 2003 */
default: assert(0);
}
@@ -4175,7 +4186,10 @@ static void free_share(INNOBASE_SHARE *share)
}
/*********************************************************************
-Stores a MySQL lock into a 'lock' field in a handle. */
+Converts a MySQL table lock stored in the 'lock' field of the handle to
+a proper type before storing the lock. MySQL also calls this when it
+releases a lock. */
+
THR_LOCK_DATA**
ha_innobase::store_lock(
@@ -4201,8 +4215,13 @@ ha_innobase::store_lock(
binlog) requires the use of a locking read */
prebuilt->select_lock_type = LOCK_S;
- } else {
- /* We set possible LOCK_X value in external_lock, not yet
+ } else if (lock_type != TL_IGNORE) {
+
+ /* In ha_berkeley.cc there is a comment that MySQL
+ may in exceptional cases call this with TL_IGNORE also
+ when it is NOT going to release the lock. */
+
+ /* We set possible LOCK_X value in external_lock, not yet
here even if this would be SELECT ... FOR UPDATE */
prebuilt->select_lock_type = LOCK_NONE;
diff --git a/sql/lex.h b/sql/lex.h
index 67b2ba85dc0..d2d26e46c1c 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -274,6 +274,7 @@ static SYMBOL symbols[] = {
{ "NULL", SYM(NULL_SYM),0,0},
{ "NUMERIC", SYM(NUMERIC_SYM),0,0},
{ "OFFSET", SYM(OFFSET_SYM),0,0},
+ { "OLD_PASSWORD", SYM(PASSWORD),0,0},
{ "ON", SYM(ON),0,0},
{ "OPEN", SYM(OPEN_SYM),0,0},
{ "OPTIMIZE", SYM(OPTIMIZE),0,0},
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 980390f04bf..3dbcdaf0537 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2564,8 +2564,7 @@ QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_SELECT *q, uint used_key_parts)
for (r = it++; r; r = it++)
{
rev_ranges.push_front(r);
- if (not_read_after_key && range_reads_after_key(r) ||
- test_if_null_range(r,used_key_parts))
+ if (not_read_after_key && range_reads_after_key(r))
{
it.rewind(); // Reset range
error = HA_ERR_UNSUPPORTED;
@@ -2734,6 +2733,7 @@ bool QUICK_SELECT_DESC::range_reads_after_key(QUICK_RANGE *range_arg)
/* True if we are reading over a key that may have a NULL value */
+#ifdef NOT_USED
bool QUICK_SELECT_DESC::test_if_null_range(QUICK_RANGE *range_arg,
uint used_key_parts)
{
@@ -2779,6 +2779,7 @@ bool QUICK_SELECT_DESC::test_if_null_range(QUICK_RANGE *range_arg,
return 1; // Covers null part
return 0;
}
+#endif
/*****************************************************************************
diff --git a/sql/opt_range.h b/sql/opt_range.h
index e96c3792f24..bc56fb99b4b 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -103,7 +103,9 @@ public:
private:
int cmp_prev(QUICK_RANGE *range);
bool range_reads_after_key(QUICK_RANGE *range);
+#ifdef NOT_USED
bool test_if_null_range(QUICK_RANGE *range, uint used_key_parts);
+#endif
void reset(void) { next=0; rev_it.rewind(); }
List<QUICK_RANGE> rev_ranges;
List_iterator<QUICK_RANGE> rev_it;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index f61ea4e8c10..00f7ed9bfc9 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -4981,6 +4981,11 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
{
if ((error=(*join_tab->next_select)(join,join_tab+1,0)) < 0)
return error;
+ /*
+ Test if this was a SELECT DISTINCT query on a table that
+ was not in the field list; In this case we can abort if
+ we found a row, as no new rows can be added to the result.
+ */
if (not_used_in_distinct && found_records != join->found_records)
return 0;
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a633c307830..44f63a2abe3 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -649,7 +649,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
insert_values update delete truncate rename
show describe load alter optimize flush
reset purge begin commit rollback slave master_def master_defs
- repair restore backup analyze check
+ repair restore backup analyze check start
field_list field_list_item field_spec kill
select_item_list select_item values_list no_braces
opt_limit_clause delete_limit_clause fields opt_values values
@@ -730,6 +730,7 @@ verb_clause:
| select
| set
| slave
+ | start
| show
| truncate
| handler
@@ -1566,6 +1567,11 @@ slave:
}
;
+start:
+ START_SYM TRANSACTION_SYM { Lex->sql_command = SQLCOM_BEGIN;}
+ {}
+ ;
+
slave_thread_opts:
slave_thread_opt
| slave_thread_opts ',' slave_thread_opt;
@@ -2421,7 +2427,7 @@ sum_expr:
{ $$=new Item_sum_and($3); }
| BIT_OR '(' in_sum_expr ')'
{ $$=new Item_sum_or($3); }
- | COUNT_SYM '(' '*' ')'
+ | COUNT_SYM '(' opt_all '*' ')'
{ $$=new Item_sum_count(new Item_int((int32) 0L,1)); }
| COUNT_SYM '(' in_sum_expr ')'
{ $$=new Item_sum_count($3); }
@@ -2441,6 +2447,7 @@ sum_expr:
{ $$=new Item_sum_sum($3); };
in_sum_expr:
+ opt_all
{
LEX *lex= Lex;
if (lex->current_select->inc_in_sum_expr())
@@ -2452,7 +2459,7 @@ in_sum_expr:
expr
{
Select->select_lex()->in_sum_expr--;
- $$=$2;
+ $$= $3;
};
cast_type:
@@ -2523,19 +2530,22 @@ opt_pad:
join_table_list:
'(' join_table_list ')' { $$=$2; }
| join_table { $$=$1; }
+ | join_table_list ',' join_table_list { $$=$3; }
| join_table_list normal_join join_table_list { $$=$3; }
| join_table_list STRAIGHT_JOIN join_table_list
{ $$=$3 ; $$->straight=1; }
- | join_table_list INNER_SYM JOIN_SYM join_table_list ON expr
- { add_join_on($4,$6); $$=$4; }
- | join_table_list INNER_SYM JOIN_SYM join_table_list
+ | join_table_list normal_join join_table_list ON expr
+ { add_join_on($3,$5); $$=$3; }
+ | join_table_list normal_join join_table_list
+ USING
{
SELECT_LEX *sel= Select->select_lex();
sel->db1=$1->db; sel->table1=$1->alias;
- sel->db2=$4->db; sel->table2=$4->alias;
+ sel->db2=$3->db; sel->table2=$3->alias;
}
- USING '(' using_list ')'
- { add_join_on($4,$8); $$=$4; }
+ '(' using_list ')'
+ { add_join_on($3,$7); $$=$3; }
+
| join_table_list LEFT opt_outer JOIN_SYM join_table_list ON expr
{ add_join_on($5,$7); $5->outer_join|=JOIN_TYPE_LEFT; $$=$5; }
| join_table_list LEFT opt_outer JOIN_SYM join_table_list
@@ -2564,9 +2574,10 @@ join_table_list:
{ add_join_natural($1,$4); $$=$4; };
normal_join:
- ',' {}
- | JOIN_SYM {}
- | CROSS JOIN_SYM {};
+ JOIN_SYM {}
+ | INNER_SYM JOIN_SYM {}
+ | CROSS JOIN_SYM {}
+ ;
join_table:
{
@@ -2712,6 +2723,10 @@ opt_table_alias:
| table_alias ident
{ $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); };
+opt_all:
+ /* empty */
+ | ALL
+ ;
where_clause:
/* empty */ { Select->select_lex()->where= 0; }