summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2006-12-19 10:40:53 +0100
committerunknown <istruewing@chilla.local>2006-12-19 10:40:53 +0100
commit9166c711c2579238713953ee882a28cbb299a0a4 (patch)
treead4eb61c5b77c490bc0d8978396b359433484fc0 /mysql-test
parenta4ad07b7eadc5f313bbaee27d084fb165274f535 (diff)
parent8ca9c9288039db167a115cadae1d514ed9ac47e3 (diff)
downloadmariadb-git-9166c711c2579238713953ee882a28cbb299a0a4.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into chilla.local:/home/mydev/mysql-4.1-axmrg
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/mtr_unique.pl12
-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.test11
4 files changed, 25 insertions, 5 deletions
diff --git a/mysql-test/lib/mtr_unique.pl b/mysql-test/lib/mtr_unique.pl
index a8fb320c773..3adc8413576 100644
--- a/mysql-test/lib/mtr_unique.pl
+++ b/mysql-test/lib/mtr_unique.pl
@@ -10,10 +10,16 @@ use Fcntl ':flock';
# Requested IDs are stored in a hash and released upon END.
#
my %mtr_unique_assigned_ids = ();
+my $mtr_unique_pid;
+BEGIN {
+ $mtr_unique_pid = $$ unless defined $mtr_unique_pid;
+}
END {
- while(my ($id,$file) = each(%mtr_unique_assigned_ids)) {
- print "Autoreleasing $file:$id\n";
- mtr_release_unique_id($file, $id);
+ if($mtr_unique_pid == $$) {
+ while(my ($id,$file) = each(%mtr_unique_assigned_ids)) {
+ print "Autoreleasing $file:$id\n";
+ mtr_release_unique_id($file, $id);
+ }
}
}
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index f7066e7edca..ce2b5deadbd 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -671,3 +671,9 @@ 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;
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 b66b97c2c41..1ae4f0ae62f 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -363,11 +363,18 @@ drop table t1;
select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))));
-# End of 4.1 tests
-
--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