Commit 6eac99a5 authored by unknown's avatar unknown
Browse files

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.com:/home/jonas/src/mysql-4.1

parents c0c65138 d393ff72
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -661,12 +661,6 @@ history_load(History *h, const char *fname)
	if ((fp = fopen(fname, "r")) == NULL)
		return (i);

	if ((line = fgetln(fp, &sz)) == NULL)
		goto done;

	if (strncmp(line, hist_cookie, sz) != 0)
		goto done;

	ptr = h_malloc(max_size = 1024);
	if (ptr == NULL)
		goto done;
@@ -720,8 +714,6 @@ history_save(History *h, const char *fname)

	if (fchmod(fileno(fp), S_IRUSR|S_IWUSR) == -1)
		goto done;
	if (fputs(hist_cookie, fp) == EOF)
		goto done;
	ptr = h_malloc(max_size = 1024);
	if (ptr == NULL)
		goto done;
@@ -740,7 +732,7 @@ history_save(History *h, const char *fname)
			ptr = nptr;
		}
		(void) strvis(ptr, ev.str, VIS_WHITE);
		(void) fprintf(fp, "%s\n", ptr);
		(void) fprintf(fp, "%s\n", ev.str);
	}
oomem:
	h_free((ptr_t)ptr);
+2 −1
Original line number Diff line number Diff line
@@ -318,4 +318,5 @@
#define ER_WARN_INVALID_TIMESTAMP 1299
#define ER_INVALID_CHARACTER_STRING 1300
#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301
#define ER_ERROR_MESSAGES 302
#define ER_CONFLICTING_DECLARATIONS 1302
#define ER_ERROR_MESSAGES 303
+8 −0
Original line number Diff line number Diff line
@@ -54,4 +54,12 @@ t1 CREATE TABLE `t1` (
  `a` char(10) collate latin1_german1_ci default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
DROP TABLE t1;
create table t1 (a char) character set latin1 character set latin2;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2'
create table t1 (a char) character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
create database d1 default character set latin1 character set latin2;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2'
create database d1 default character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
DROP DATABASE mysqltest1;
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ GRANT USAGE ON *.* TO '
GRANT SELECT () ON ``.`` TO ''@'localhost'
REVOKE SELECT () ON . FROM @localhost;
DROP DATABASE ;
SET NAMES binary;
SET NAMES latin1;
insert into mysql.user (host, user) values ('localhost', 'test11');
insert into mysql.db (host, db, user, select_priv) values 
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
+12 −0
Original line number Diff line number Diff line
@@ -71,6 +71,18 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;

#
# Bug#
# CREATE TABLE and CREATE DATABASE didn't fail in some cases
#
--error 1302
create table t1 (a char) character set latin1 character set latin2;
--error 1253
create table t1 (a char) character set latin1 collate latin2_bin;
--error 1302
create database d1 default character set latin1 character set latin2;
--error 1253
create database d1 default character set latin1 collate latin2_bin; 

#
#
DROP DATABASE mysqltest1;
Loading