summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-05-13 22:09:03 +0300
committerunknown <monty@narttu.mysql.fi>2003-05-13 22:09:03 +0300
commit21b5aecff1435270754ccbc28bf6754fe5b6f9e3 (patch)
tree9e9c5202a9c1c746912140bf3a3529b3d968c946
parentd4ae4f0ec0e43f395722dbd1153938c66658b037 (diff)
parent517bbaceeef0e488d39f1d8e689748cc7d50262c (diff)
downloadmariadb-git-21b5aecff1435270754ccbc28bf6754fe5b6f9e3.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into narttu.mysql.fi:/my/mysql-4.0
-rw-r--r--man/Makefile.am2
-rw-r--r--man/isamchk.12
-rw-r--r--man/isamlog.12
-rw-r--r--man/mysql.12
-rw-r--r--man/mysql_fix_privilege_tables.123
-rw-r--r--man/mysql_zap.12
-rw-r--r--man/mysqlaccess.12
-rw-r--r--man/mysqladmin.12
-rw-r--r--man/mysqld.12
-rw-r--r--man/mysqld_multi.12
-rw-r--r--man/mysqld_safe.12
-rw-r--r--man/mysqldump.12
-rw-r--r--man/mysqlshow.12
-rw-r--r--man/perror.12
-rw-r--r--man/replace.12
-rw-r--r--mysql-test/r/create.result13
-rw-r--r--mysql-test/r/innodb.result12
-rw-r--r--mysql-test/r/key.result1
-rw-r--r--mysql-test/t/create.test12
-rw-r--r--mysql-test/t/innodb.test8
-rw-r--r--mysql-test/t/key.test6
-rw-r--r--sql/sql_table.cc5
22 files changed, 66 insertions, 42 deletions
diff --git a/man/Makefile.am b/man/Makefile.am
index 7019d2aa865..9f919e77b8f 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -19,7 +19,7 @@
man_MANS = mysql.1 isamchk.1 isamlog.1 mysql_zap.1 mysqlaccess.1 \
mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \
- perror.1 replace.1 mysqld_safe.1
+ perror.1 replace.1 mysqld_safe.1 mysql_fix_privilege_tables.1
EXTRA_DIST = $(man_MANS)
diff --git a/man/isamchk.1 b/man/isamchk.1
index bfc4ccd9c08..341e968a131 100644
--- a/man/isamchk.1
+++ b/man/isamchk.1
@@ -1,4 +1,4 @@
-.TH isamchk 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH isamchk 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
.BR isamchk
\- Description, check and repair of ISAM tables.
diff --git a/man/isamlog.1 b/man/isamlog.1
index a386f11c010..402c3052ad8 100644
--- a/man/isamlog.1
+++ b/man/isamlog.1
@@ -1,4 +1,4 @@
-.TH isamlog 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH isamlog 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
isamlog - Write info about whats in a nisam log file.
.SH USAGE
diff --git a/man/mysql.1 b/man/mysql.1
index 6664581072f..c0c37716b14 100644
--- a/man/mysql.1
+++ b/man/mysql.1
@@ -1,4 +1,4 @@
-.TH mysql 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH mysql 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
mysql \- text-based client for mysqld, a SQL-based relational database daemon
.SH SYNOPSIS
diff --git a/man/mysql_fix_privilege_tables.1 b/man/mysql_fix_privilege_tables.1
new file mode 100644
index 00000000000..bf4e0e15dfa
--- /dev/null
+++ b/man/mysql_fix_privilege_tables.1
@@ -0,0 +1,23 @@
+.TH mysql 1 "17 March 2003" "MySQL 4.0" "MySQL database"
+.SH NAME
+mysql_fix_privilege_tables \- Fixes MySQL privilege tables.
+.SH SYNOPSIS
+mysql_fix_privilege_tables [options]
+.SH DESCRIPTION
+This scripts updates the mysql.user, mysql.db, mysql.host and the
+mysql.func tables to MySQL 3.22.14 and above.
+
+This is needed if you want to use the new GRANT functions,
+CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23
+
+If you get 'Access denied' errors, you should run this script again
+and give the MySQL root user password as an argument!
+
+For more information start the program with '--help'.
+.SH "SEE ALSO"
+mysql (1), mysqld (1)
+.SH AUTHOR
+This manpage was written by Christian Hammers <ch@debian.org>.
+
+MySQL is available at http://www.mysql.com/.
+.\" end of man page
diff --git a/man/mysql_zap.1 b/man/mysql_zap.1
index 144fc212372..71931c03db6 100644
--- a/man/mysql_zap.1
+++ b/man/mysql_zap.1
@@ -1,4 +1,4 @@
-.TH zap 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH zap 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
zap - a perl script used to kill processes
.SH USAGE
diff --git a/man/mysqlaccess.1 b/man/mysqlaccess.1
index c1c61d4a8a7..fc7c185e050 100644
--- a/man/mysqlaccess.1
+++ b/man/mysqlaccess.1
@@ -1,4 +1,4 @@
-.TH mysqlaccess 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH mysqlaccess 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
.BR mysqlaccess
\- Create new users to mysql.
diff --git a/man/mysqladmin.1 b/man/mysqladmin.1
index 9d7d73aad21..693e8aa5a72 100644
--- a/man/mysqladmin.1
+++ b/man/mysqladmin.1
@@ -1,4 +1,4 @@
-.TH mysqladmin 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH mysqladmin 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations
.SH OPTION SYNOPSIS
diff --git a/man/mysqld.1 b/man/mysqld.1
index 0a6fcccbef2..98247cd9445 100644
--- a/man/mysqld.1
+++ b/man/mysqld.1
@@ -1,4 +1,4 @@
-.TH mysqld 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH mysqld 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
.BR mysqld
\- Starts the MySQL server demon
diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1
index 68b9d1e876f..47418835939 100644
--- a/man/mysqld_multi.1
+++ b/man/mysqld_multi.1
@@ -1,4 +1,4 @@
-.TH mysqld_multi 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH mysqld_multi 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports.
.SH USAGE
diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1
index b8271c848cc..3679346d7db 100644
--- a/man/mysqld_safe.1
+++ b/man/mysqld_safe.1
@@ -1,4 +1,4 @@
-.TH safe_mysqld 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH safe_mysqld 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
mysqld_safe \- start the mysqld daemon on Unix.
.SH SYNOPSIS
diff --git a/man/mysqldump.1 b/man/mysqldump.1
index b4aba2ade13..af50366f24c 100644
--- a/man/mysqldump.1
+++ b/man/mysqldump.1
@@ -1,4 +1,4 @@
-.TH mysqldump 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH mysqldump 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
mysqldump \- text-based client for dumping or backing up mysql databases , tables and or data.
diff --git a/man/mysqlshow.1 b/man/mysqlshow.1
index b6aceec82e3..39590b54375 100644
--- a/man/mysqlshow.1
+++ b/man/mysqlshow.1
@@ -1,4 +1,4 @@
-.TH mysqlshow 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH mysqlshow 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
.BR mysqlshow
\- Shows the structure of a mysql database (databases,tables and columns)
diff --git a/man/perror.1 b/man/perror.1
index 2c5dd9a295f..b8eec8af318 100644
--- a/man/perror.1
+++ b/man/perror.1
@@ -1,4 +1,4 @@
-.TH perror 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH perror 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
perror \- describes a system or MySQL error code.
.SH SYNOPSIS
diff --git a/man/replace.1 b/man/replace.1
index 7c3b79f605b..46d542d57f4 100644
--- a/man/replace.1
+++ b/man/replace.1
@@ -1,4 +1,4 @@
-.TH replace 1 "19 December 2000" "MySQL 3.23" "MySQL database"
+.TH replace 1 "19 December 2000" "MySQL 4.0" "MySQL database"
.SH NAME
.TP
replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings.
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index a2ab0e97905..2e2aa41c671 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -25,13 +25,9 @@ create table t1 (a int not null auto_increment,primary key (a)) type=heap;
The used table type doesn't support AUTO_INCREMENT columns
create table t1 (a int not null,b text) type=heap;
The used table type doesn't support BLOB/TEXT columns
-create table t1 (a int ,primary key(a)) type=heap;
-All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead
drop table if exists t1;
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap;
The used table type doesn't support AUTO_INCREMENT columns
-create table t1 (ordid int(8), primary key (ordid));
-All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead
create table not_existing_database.test (a int);
Got one of the listed errors
create table `a/a` (a int);
@@ -171,3 +167,12 @@ t1 CREATE TABLE `t1` (
) TYPE=MyISAM
SET SESSION table_type=default;
drop table t1;
+create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
+insert into t1 values ("a", 1), ("b", 2);
+insert into t1 values ("c", NULL);
+Column 'k2' cannot be null
+insert into t1 values (NULL, 3);
+Column 'k1' cannot be null
+insert into t1 values (NULL, NULL);
+Column 'k1' cannot be null
+drop table t1;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index b3c7c137a6f..e2dea324ff2 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -138,15 +138,6 @@ id parent_id level
1008 102 2
1010 102 2
1015 102 2
-explain select level from t1 where level=1;
-table type possible_keys key key_len ref rows Extra
-t1 ref level level 1 const 12 Using where; Using index
-explain select level,id from t1 where level=1;
-table type possible_keys key key_len ref rows Extra
-t1 ref level level 1 const 12 Using where; Using index
-explain select level,id,parent_id from t1 where level=1;
-table type possible_keys key key_len ref rows Extra
-t1 ref level level 1 const 12 Using where
select level,id from t1 where level=1;
level id
1 1002
@@ -595,9 +586,6 @@ id parent_id level
1009 102 2
1025 102 2
1016 102 2
-explain select level from t1 where level=1;
-table type possible_keys key key_len ref rows Extra
-t1 ref level level 1 const 6 Using where; Using index
select level,id from t1 where level=1;
level id
1 1004
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 1cd9c9dfe79..31d35a681aa 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -42,7 +42,6 @@ price area type transityes shopsyes schoolsyes petsyes
drop table t1;
CREATE TABLE t1 (program enum('signup','unique','sliding') not null, type enum('basic','sliding','signup'), sites set('mt'), PRIMARY KEY (program));
ALTER TABLE t1 modify program enum('signup','unique','sliding');
-All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead
drop table t1;
CREATE TABLE t1 (
name varchar(50) DEFAULT '' NOT NULL,
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 68d68929f07..86c3f6be0f5 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -24,11 +24,9 @@ drop table if exists t1,t2;
!$1167 create table t1 (b char(0) not null, index(b));
!$1164 create table t1 (a int not null auto_increment,primary key (a)) type=heap;
!$1163 create table t1 (a int not null,b text) type=heap;
-!$1171 create table t1 (a int ,primary key(a)) type=heap;
drop table if exists t1;
!$1164 create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap;
-!$1171 create table t1 (ordid int(8), primary key (ordid));
-- error 1044,1
create table not_existing_database.test (a int);
@@ -119,3 +117,13 @@ show create table t1;
SET SESSION table_type=default;
drop table t1;
+
+#
+# ISO requires that primary keys are implicitly NOT NULL
+#
+create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
+insert into t1 values ("a", 1), ("b", 2);
+!$1048 insert into t1 values ("c", NULL);
+!$1048 insert into t1 values (NULL, 3);
+!$1048 insert into t1 values (NULL, NULL);
+drop table t1;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index ae1f7dae922..dc3c76f1a91 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -40,9 +40,9 @@ update ignore t1 set id=id+1; # This will change all rows
select * from t1;
update ignore t1 set id=1023 where id=1010;
select * from t1 where parent_id=102;
-explain select level from t1 where level=1;
-explain select level,id from t1 where level=1;
-explain select level,id,parent_id from t1 where level=1;
+# explain select level from t1 where level=1;
+# explain select level,id from t1 where level=1;
+# explain select level,id,parent_id from t1 where level=1;
select level,id from t1 where level=1;
select level,id,parent_id from t1 where level=1;
optimize table t1;
@@ -339,7 +339,7 @@ update ignore t1 set id=id+1; # This will change all rows
select * from t1;
update ignore t1 set id=1023 where id=1010;
select * from t1 where parent_id=102;
-explain select level from t1 where level=1;
+# explain select level from t1 where level=1;
select level,id from t1 where level=1;
select level,id,parent_id from t1 where level=1;
select level,id from t1 where level=1 order by id;
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 1996c793880..cb80d88aee8 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -54,12 +54,12 @@ INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
drop table t1;
#
-# problem med primary key
+# No longer a problem with primary key
#
CREATE TABLE t1 (program enum('signup','unique','sliding') not null, type enum('basic','sliding','signup'), sites set('mt'), PRIMARY KEY (program));
-# The following should give an error for wrong primary key
-!$1171 ALTER TABLE t1 modify program enum('signup','unique','sliding');
+# This no longer give an error for wrong primary key
+ALTER TABLE t1 modify program enum('signup','unique','sliding');
drop table t1;
#
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 745d9ea1084..90239c1c7ea 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -598,8 +598,9 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
{
if (key->type == Key::PRIMARY)
{
- my_error(ER_PRIMARY_CANT_HAVE_NULL, MYF(0));
- DBUG_RETURN(-1);
+ /* Implicitly set primary key fields to NOT NULL for ISO conf. */
+ sql_field->flags|= NOT_NULL_FLAG;
+ sql_field->pack_flag&= ~FIELDFLAG_MAYBE_NULL;
}
if (!(file->table_flags() & HA_NULL_KEY))
{