~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysql-test/t/gis.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
358
358
 
359
359
# Expected result is 36.3310176346905, but IA64 returns 36.3310176346904
360
360
# due to fused multiply-add instructions.
361
 
--replace_result 36.3310176346904 36.3310176346905
 
361
--replace_result 36.3310176346904 36.3310176346905 -114.87787186923326 -114.87787186923313 36.33101763469053 36.33101763469059 36.33101763469043 36.33101763469059
362
362
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
363
363
t1 where object_id=85984;
364
364
 
401
401
insert into t1 values (1, ''), (2, NULL), (3, '1');
402
402
select * from t1;
403
403
 
 
404
--error ER_ILLEGAL_VALUE_FOR_TYPE
404
405
select
405
406
  geometryfromtext(b) IS NULL, geometryfromwkb(b) IS NULL, astext(b) IS NULL, 
406
407
  aswkb(b) IS NULL, geometrytype(b) IS NULL, centroid(b) IS NULL,
419
420
  intersects(b, b) IS NULL, crosses(b, b) IS NULL
420
421
from t1;
421
422
 
 
423
--error ER_ILLEGAL_VALUE_FOR_TYPE
422
424
select 
423
425
  point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS NULL, 
424
426
  multilinestring(b) IS NULL, multipolygon(b) IS NULL, 
702
704
# Bug#44684: valgrind reports invalid reads in 
703
705
# Item_func_spatial_collection::val_str
704
706
#
 
707
--error ER_ILLEGAL_VALUE_FOR_TYPE
705
708
SELECT MultiPoint(12345,'');
706
 
SELECT MultiPoint(123451,'');
707
 
SELECT MultiPoint(1234512,'');
708
 
SELECT MultiPoint(12345123,'');
709
 
 
710
 
SELECT MultiLineString(12345,'');
711
 
SELECT MultiLineString(123451,'');
712
 
SELECT MultiLineString(1234512,'');
713
 
SELECT MultiLineString(12345123,'');
714
 
 
715
 
SELECT LineString(12345,'');
716
 
SELECT LineString(123451,'');
717
 
SELECT LineString(1234512,'');
718
 
SELECT LineString(12345123,'');
719
 
 
720
 
SELECT Polygon(12345,'');
721
 
SELECT Polygon(123451,'');
722
 
SELECT Polygon(1234512,'');
723
 
SELECT Polygon(12345123,'');
 
709
#SELECT MultiPoint(123451,'');
 
710
#SELECT MultiPoint(1234512,'');
 
711
#SELECT MultiPoint(12345123,'');
 
712
 
 
713
--error ER_ILLEGAL_VALUE_FOR_TYPE
 
714
#SELECT MultiLineString(12345,'');
 
715
#SELECT MultiLineString(123451,'');
 
716
#SELECT MultiLineString(1234512,'');
 
717
#SELECT MultiLineString(12345123,'');
 
718
 
 
719
--error ER_ILLEGAL_VALUE_FOR_TYPE
 
720
#SELECT LineString(12345,'');
 
721
#SELECT LineString(123451,'');
 
722
#SELECT LineString(1234512,'');
 
723
#SELECT LineString(12345123,'');
 
724
 
 
725
--error ER_ILLEGAL_VALUE_FOR_TYPE
 
726
#SELECT Polygon(12345,'');
 
727
#SELECT Polygon(123451,'');
 
728
#SELECT Polygon(1234512,'');
 
729
#SELECT Polygon(12345123,'');
 
730
 
 
731
#
 
732
# Bug55531 crash with conversions of geometry types / strings
 
733
#
 
734
--error ER_ILLEGAL_VALUE_FOR_TYPE
 
735
SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUAL) AS d WHERE (LINESTRING(d.b));
 
736
 
 
737
 
 
738
--echo #
 
739
--echo # BUG#51875: crash when loading data into geometry function polyfromwkb
 
740
--echo #
 
741
SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440;
 
742
SET @a=POLYFROMWKB(@a);
 
743
SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440;
 
744
SET @a=POLYFROMWKB(@a);
 
745
 
 
746
 
 
747
#
 
748
# Bug #57321    crashes and valgrind errors from spatial types
 
749
#
 
750
 
 
751
create table t1(a polygon NOT NULL)engine=myisam;
 
752
insert into t1 values (geomfromtext("point(0 1)"));
 
753
insert into t1 values (geomfromtext("point(1 0)"));
 
754
select * from (select polygon(t1.a) as p from t1 order by t1.a) d;
 
755
drop table t1;
 
756
 
 
757
 
 
758
--echo #
 
759
--echo # Test for bug #59888 "debug assertion when attempt to create spatial index
 
760
--echo #                      on char > 31 bytes".
 
761
--echo #
 
762
create table t1(a char(32) not null) engine=myisam;
 
763
--error ER_WRONG_ARGUMENTS
 
764
create spatial index i on t1 (a);
 
765
drop table t1;
 
766
 
 
767
 
 
768
#
 
769
# Bug#11767480 - SPATIAL INDEXES ON NON-SPATIAL COLUMNS CAUSE CRASHES.
 
770
#
 
771
CREATE TABLE t0 (a BINARY(32) NOT NULL);
 
772
--error ER_WRONG_ARGUMENTS
 
773
CREATE SPATIAL INDEX i on t0 (a);
 
774
INSERT INTO t0 VALUES (1);
 
775
 
 
776
--error ER_WRONG_ARGUMENTS
 
777
CREATE TABLE t1(
 
778
  col0 BINARY NOT NULL,
 
779
  col2 TIMESTAMP,
 
780
  SPATIAL INDEX i1 (col0)
 
781
) ENGINE=MyISAM;
 
782
 
 
783
# Test other ways to add indices
 
784
CREATE TABLE t1 (
 
785
  col0 BINARY NOT NULL,
 
786
  col2 TIMESTAMP
 
787
) ENGINE=MyISAM;
 
788
 
 
789
--error ER_WRONG_ARGUMENTS
 
790
CREATE SPATIAL INDEX idx0 ON t1(col0);
 
791
 
 
792
--error ER_WRONG_ARGUMENTS
 
793
ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0);
 
794
 
 
795
CREATE TABLE t2 (
 
796
  col0 INTEGER NOT NULL,
 
797
  col1 POINT,
 
798
  col2 POINT
 
799
);
 
800
 
 
801
--error ER_WRONG_ARGUMENTS
 
802
CREATE SPATIAL INDEX idx0 ON t2 (col1, col2);
 
803
 
 
804
--error ER_WRONG_ARGUMENTS
 
805
CREATE TABLE t3 (
 
806
  col0 INTEGER NOT NULL,
 
807
  col1 POINT,
 
808
  col2 LINESTRING,
 
809
  SPATIAL INDEX i1 (col1, col2)
 
810
);
 
811
 
 
812
# cleanup
 
813
DROP TABLE t0, t1, t2;
724
814
 
725
815
--echo End of 5.1 tests