Commit e4d32625 authored by jimw@rama.(none)'s avatar jimw@rama.(none)

Merge bk-internal:/home/bk/mysql-5.0-maint

into  rama.(none):/home/jimw/my/mysql-5.0-19498
parents 10f3b6aa d18eacc7
...@@ -967,6 +967,8 @@ CREATE TABLE federated.t1 ( ...@@ -967,6 +967,8 @@ CREATE TABLE federated.t1 (
`blurb` text default '', `blurb` text default '',
PRIMARY KEY (blurb_id)) PRIMARY KEY (blurb_id))
DEFAULT CHARSET=latin1; DEFAULT CHARSET=latin1;
Warnings:
Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 ( CREATE TABLE federated.t1 (
`blurb_id` int NOT NULL DEFAULT 0, `blurb_id` int NOT NULL DEFAULT 0,
...@@ -975,6 +977,8 @@ PRIMARY KEY (blurb_id)) ...@@ -975,6 +977,8 @@ PRIMARY KEY (blurb_id))
ENGINE="FEDERATED" ENGINE="FEDERATED"
DEFAULT CHARSET=latin1 DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
Warnings:
Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values."); INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.");
INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE."); INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. "); INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
......
...@@ -8,6 +8,8 @@ KEY kt(tag), ...@@ -8,6 +8,8 @@ KEY kt(tag),
KEY kv(value(15)), KEY kv(value(15)),
FULLTEXT KEY kvf(value) FULLTEXT KEY kvf(value)
) ENGINE=MyISAM; ) ENGINE=MyISAM;
Warnings:
Warning 1101 BLOB/TEXT column 'value' can't have a default value
CREATE TABLE t2 ( CREATE TABLE t2 (
id_t2 mediumint unsigned NOT NULL default '0', id_t2 mediumint unsigned NOT NULL default '0',
id_t1 mediumint unsigned NOT NULL default '0', id_t1 mediumint unsigned NOT NULL default '0',
......
...@@ -9,6 +9,8 @@ name VARCHAR(80) DEFAULT '' NOT NULL, ...@@ -9,6 +9,8 @@ name VARCHAR(80) DEFAULT '' NOT NULL,
FULLTEXT(url,description,shortdesc,longdesc), FULLTEXT(url,description,shortdesc,longdesc),
PRIMARY KEY(gnr) PRIMARY KEY(gnr)
); );
Warnings:
Warning 1101 BLOB/TEXT column 'longdesc' can't have a default value
insert into test (url,shortdesc,longdesc,description,name) VALUES insert into test (url,shortdesc,longdesc,description,name) VALUES
("http:/test.at", "kurz", "lang","desc", "name"); ("http:/test.at", "kurz", "lang","desc", "name");
insert into test (url,shortdesc,longdesc,description,name) VALUES insert into test (url,shortdesc,longdesc,description,name) VALUES
......
...@@ -804,6 +804,8 @@ INSERT INTO t2 SELECT GeomFromText(st) FROM t1; ...@@ -804,6 +804,8 @@ INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1, t2; drop table t1, t2;
CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Warnings:
Warning 1101 BLOB/TEXT column 'geometry' can't have a default value
INSERT INTO t1 (geometry) VALUES INSERT INTO t1 (geometry) VALUES
(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
-66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999, -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
...@@ -820,6 +822,8 @@ CREATE TABLE t1 ( ...@@ -820,6 +822,8 @@ CREATE TABLE t1 (
c1 geometry NOT NULL default '', c1 geometry NOT NULL default '',
SPATIAL KEY i1 (c1(32)) SPATIAL KEY i1 (c1(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Warnings:
Warning 1101 BLOB/TEXT column 'c1' can't have a default value
INSERT INTO t1 (c1) VALUES ( INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999, -18.6055555000 -66.8158332999,
...@@ -834,6 +838,8 @@ CREATE TABLE t1 ( ...@@ -834,6 +838,8 @@ CREATE TABLE t1 (
c1 geometry NOT NULL default '', c1 geometry NOT NULL default '',
SPATIAL KEY i1 (c1(32)) SPATIAL KEY i1 (c1(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Warnings:
Warning 1101 BLOB/TEXT column 'c1' can't have a default value
INSERT INTO t1 (c1) VALUES ( INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999, -18.6055555000 -66.8158332999,
......
...@@ -583,6 +583,8 @@ t1 CREATE TABLE `t1` ( ...@@ -583,6 +583,8 @@ t1 CREATE TABLE `t1` (
drop table t1; drop table t1;
CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo`
geometry NOT NULL default '') ENGINE=MyISAM ; geometry NOT NULL default '') ENGINE=MyISAM ;
Warnings:
Warning 1101 BLOB/TEXT column 'geo' can't have a default value
insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163 36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163
36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363 36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363
......
...@@ -598,6 +598,8 @@ id int(11) DEFAULT '0' NOT NULL, ...@@ -598,6 +598,8 @@ id int(11) DEFAULT '0' NOT NULL,
name tinytext DEFAULT '' NOT NULL, name tinytext DEFAULT '' NOT NULL,
UNIQUE id (id) UNIQUE id (id)
); );
Warnings:
Warning 1101 BLOB/TEXT column 'name' can't have a default value
INSERT INTO t1 VALUES (1,'yes'),(2,'no'); INSERT INTO t1 VALUES (1,'yes'),(2,'no');
CREATE TABLE t2 ( CREATE TABLE t2 (
id int(11) DEFAULT '0' NOT NULL, id int(11) DEFAULT '0' NOT NULL,
......
...@@ -280,6 +280,8 @@ info text NOT NULL default '', ...@@ -280,6 +280,8 @@ info text NOT NULL default '',
ipnr varchar(30) NOT NULL default '', ipnr varchar(30) NOT NULL default '',
PRIMARY KEY (member_id) PRIMARY KEY (member_id)
) ENGINE=MyISAM PACK_KEYS=1; ) ENGINE=MyISAM PACK_KEYS=1;
Warnings:
Warning 1101 BLOB/TEXT column 'info' can't have a default value
insert into t1 (member_id) values (1),(2),(3); insert into t1 (member_id) values (1),(2),(3);
select member_id, nickname, voornaam FROM t1 select member_id, nickname, voornaam FROM t1
ORDER by lastchange_datum DESC LIMIT 2; ORDER by lastchange_datum DESC LIMIT 2;
......
...@@ -503,6 +503,8 @@ foobar boggle ...@@ -503,6 +503,8 @@ foobar boggle
fish 10 fish 10
drop table t1; drop table t1;
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default ''); create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default '');
Warnings:
Warning 1101 BLOB/TEXT column 'imagem' can't have a default value
insert into t1 (id) values (1); insert into t1 (id) values (1);
select select
charset(load_file('../../std_data/words.dat')), charset(load_file('../../std_data/words.dat')),
...@@ -788,3 +790,21 @@ NULL ...@@ -788,3 +790,21 @@ NULL
616100000000 616100000000
620000000000 620000000000
drop table t1; drop table t1;
create table t1 (a text default '');
Warnings:
Warning 1101 BLOB/TEXT column 'a' can't have a default value
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (default);
select * from t1;
a
NULL
drop table t1;
set @@sql_mode='TRADITIONAL';
create table t1 (a text default '');
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
set @@sql_mode='';
End of 5.0 tests
...@@ -38,6 +38,9 @@ KEY (ulong), ...@@ -38,6 +38,9 @@ KEY (ulong),
KEY (ulonglong,ulong), KEY (ulonglong,ulong),
KEY (options,flags) KEY (options,flags)
); );
Warnings:
Warning 1101 BLOB/TEXT column 'mediumblob_col' can't have a default value
Warning 1101 BLOB/TEXT column 'longblob_col' can't have a default value
show full fields from t1; show full fields from t1;
Field Type Collation Null Key Default Extra Privileges Comment Field Type Collation Null Key Default Extra Privileges Comment
auto int(5) unsigned NULL NO PRI NULL auto_increment # auto int(5) unsigned NULL NO PRI NULL auto_increment #
......
...@@ -423,3 +423,18 @@ alter table t1 modify a binary(5); ...@@ -423,3 +423,18 @@ alter table t1 modify a binary(5);
select hex(a) from t1 order by a; select hex(a) from t1 order by a;
select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
drop table t1; drop table t1;
#
# Bug #19489: Inconsistent support for DEFAULT in TEXT columns
#
create table t1 (a text default '');
show create table t1;
insert into t1 values (default);
select * from t1;
drop table t1;
set @@sql_mode='TRADITIONAL';
--error ER_BLOB_CANT_HAVE_DEFAULT
create table t1 (a text default '');
set @@sql_mode='';
--echo End of 5.0 tests
...@@ -8363,7 +8363,8 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type, ...@@ -8363,7 +8363,8 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
comment= *fld_comment; comment= *fld_comment;
/* /*
Set flag if this field doesn't have a default value Set NO_DEFAULT_VALUE_FLAG if this field doesn't have a default value and
it is NOT NULL, not an AUTO_INCREMENT field and not a TIMESTAMP.
*/ */
if (!fld_default_value && !(fld_type_modifier & AUTO_INCREMENT_FLAG) && if (!fld_default_value && !(fld_type_modifier & AUTO_INCREMENT_FLAG) &&
(fld_type_modifier & NOT_NULL_FLAG) && fld_type != FIELD_TYPE_TIMESTAMP) (fld_type_modifier & NOT_NULL_FLAG) && fld_type != FIELD_TYPE_TIMESTAMP)
...@@ -8440,12 +8441,28 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type, ...@@ -8440,12 +8441,28 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
/* Allow empty as default value. */ /* Allow empty as default value. */
String str,*res; String str,*res;
res= fld_default_value->val_str(&str); res= fld_default_value->val_str(&str);
if (res->length()) /*
A default other than '' is always an error, and any non-NULL
specified default is an error in strict mode.
*/
if (res->length() || (thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)))
{ {
my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0),
fld_name); /* purecov: inspected */ fld_name); /* purecov: inspected */
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
else
{
/*
Otherwise a default of '' is just a warning.
*/
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BLOB_CANT_HAVE_DEFAULT,
ER(ER_BLOB_CANT_HAVE_DEFAULT),
fld_name);
}
def= 0; def= 0;
} }
flags|= BLOB_FLAG; flags|= BLOB_FLAG;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment