summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@mysql.com/deer.(none)>2006-12-06 22:02:39 +0400
committerunknown <holyfoot/hf@mysql.com/deer.(none)>2006-12-06 22:02:39 +0400
commit8f3c395c260f40c519444441297b979a5f09f6bf (patch)
treee175bfe15e5395d0886dfa5d2e07539352f7b0f9 /mysql-test
parent85b1701ab7292eeee4ce4b253909ae68345be43c (diff)
parent63fce3a24e33407d58a17ec2946caa08e6c1b537 (diff)
downloadmariadb-git-8f3c395c260f40c519444441297b979a5f09f6bf.tar.gz
Merge mysql.com:/home/hf/work/22372/my41-22372
into mysql.com:/home/hf/work/22372/my50-22372 mysql-test/r/gis.result: merging mysql-test/t/gis.test: merging sql/field.cc: merging sql/field.h: merging sql/sql_load.cc: merging
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/gis.result6
-rw-r--r--mysql-test/std_data/bad_gis_data.dat1
-rw-r--r--mysql-test/t/gis.test22
3 files changed, 21 insertions, 8 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 46aecde2cc5..c4c073f047a 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -706,6 +706,12 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def asbinary(g) 252 8192 0 Y 128 0 63
asbinary(g)
drop table t1;
+create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
+alter table t1 disable keys;
+load data infile '../../std_data/bad_gis_data.dat' into table t1;
+ERROR 01000: Data truncated; NULL supplied to NOT NULL column 'b' at row 1
+alter table t1 enable keys;
+drop table t1;
create table t1 select GeomFromText('point(1 1)');
desc t1;
Field Type Null Key Default Extra
diff --git a/mysql-test/std_data/bad_gis_data.dat b/mysql-test/std_data/bad_gis_data.dat
new file mode 100644
index 00000000000..257cc5642cb
--- /dev/null
+++ b/mysql-test/std_data/bad_gis_data.dat
@@ -0,0 +1 @@
+foo
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 7bba34be3ff..a9840c9b3b4 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -375,6 +375,20 @@ drop table t1;
select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))));
+--enable_metadata
+create table t1 (g GEOMETRY);
+select * from t1;
+select asbinary(g) from t1;
+--disable_metadata
+drop table t1;
+
+create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
+alter table t1 disable keys;
+--error 1263
+load data infile '../../std_data/bad_gis_data.dat' into table t1;
+alter table t1 enable keys;
+drop table t1;
+
# End of 4.1 tests
#
@@ -410,15 +424,7 @@ alter table t1 add primary key pti(pt);
alter table t1 add primary key pti(pt(20));
drop table t1;
---enable_metadata
-create table t1 (g GEOMETRY);
-select * from t1;
-select asbinary(g) from t1;
---disable_metadata
-drop table t1;
-
create table t1 select GeomFromText('point(1 1)');
desc t1;
drop table t1;
-