Commit ae47b50c authored by unknown's avatar unknown
Browse files

Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/usr/home/ram/work/5.0.b14290

parents 48765db2 bc7f923a
Loading
Loading
Loading
Loading
+20 −21
Original line number Diff line number Diff line
@@ -97,36 +97,35 @@ tags:
	support-files/build-tags
.PHONY:		init-db bin-dist

# Test installation. Ports are configurable from the environment.

MYSQL_TEST_MANAGER_PORT =	9305
MYSQL_TEST_MASTER_PORT =	9306
MYSQL_TEST_SLAVE_PORT =		9308
MYSQL_TEST_NDB_PORT =		9350
MYSQL_TEST_RUN_ARGS =		--manager-port=$(MYSQL_TEST_MANAGER_PORT) \
				--master_port=$(MYSQL_TEST_MASTER_PORT) \
				--slave_port=$(MYSQL_TEST_SLAVE_PORT) \
				--ndbcluster_port=$(MYSQL_TEST_NDB_PORT)
# Target 'test' will run the regression test suite using the built server.
#
# If you are running in a shared environment, users can avoid clashing
# port numbers by setting individual small numbers 1-100 to the
# environment variable MTR_BUILD_THREAD. The script "mysql-test-run"
# will then calculate the various port numbers it needs from this,
# making sure each user use different ports.

test:
	cd mysql-test ; \
	./mysql-test-run $(MYSQL_TEST_RUN_ARGS) && \
	./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol
	./mysql-test-run && \
	./mysql-test-run --ps-protocol

test-force:
	cd mysql-test; \
	./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --force ; \
	./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol --force
	./mysql-test-run --force ; \
	./mysql-test-run --ps-protocol --force

# We are testing a new Perl version of the test script
test-pl:
	cd mysql-test; \
	./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) && \
	./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --ps-protocol
	./mysql-test-run.pl && \
	./mysql-test-run.pl --ps-protocol

test-force-pl:
	cd mysql-test; \
	./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --force ; \
	./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --ps-protocol --force
	./mysql-test-run.pl --force ; \
	./mysql-test-run.pl --ps-protocol --force

# Don't update the files from bitkeeper
%::SCCS/s.%
+78 −70
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ static struct my_option my_long_options[] =
     (gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL,
     NO_ARG, 1, 0, 0, 0, 0, 0},
  {"tz-utc", OPT_TZ_UTC,
    "SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data between servers with different time zones.",
    "SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
    (gptr*) &opt_tz_utc, (gptr*) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
  {"user", 'u', "User for login if not current user.",
@@ -1328,17 +1328,17 @@ static uint dump_routines_for_db(char *db)
static uint get_table_structure(char *table, char *db, char *table_type,
                                char *ignore_flag)
{
  MYSQL_RES  *tableRes;
  MYSQL_ROW  row;
  my_bool    init=0, delayed, write_data, complete_insert;
  uint       num_fields;
  my_ulonglong num_fields;
  char	     *result_table, *opt_quoted_table;
  const char *insert_option;
  char	     name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
  char	     table_buff2[NAME_LEN*2+3];
  char       query_buff[512];
  char	     table_buff2[NAME_LEN*2+3], query_buff[512];
  FILE       *sql_file = md_result_file;
  int        len;
  MYSQL_RES  *result;
  MYSQL_ROW  row;

  DBUG_ENTER("get_table_structure");
  DBUG_PRINT("enter", ("db: %s  table: %s", db, table));

@@ -1424,71 +1424,79 @@ static uint get_table_structure(char *table, char *db, char *table_type,
	check_io(sql_file);
      }

      tableRes= mysql_store_result(sock);
      field= mysql_fetch_field_direct(tableRes, 0);
      result= mysql_store_result(sock);
      field= mysql_fetch_field_direct(result, 0);
      if (strcmp(field->name, "View") == 0)
      {
        if (verbose)
          fprintf(stderr, "-- It's a view, create dummy table for view\n");

        mysql_free_result(tableRes);
        mysql_free_result(result);

        /*
          Create a table with the same name as the view and with columns of 
          the same name in order to satisfy views that depend on this view.
          The table will be removed when the actual view is created.

        /* Create a dummy table for the view. ie. a table  which has the
           same columns as the view should have. This table is dropped
           just before the view is created. The table is used to handle the
           case where a view references another view, which hasn't yet been
           created(during the load of the dump). BUG#10927 */
          The properties of each column, aside from the data type, are not
          preserved in this temporary table, because they are not necessary.

        /* Create temp table by selecting from the view */
          This will not be necessary once we can determine dependencies
          between views and can simply dump them in the appropriate order.
        */
        my_snprintf(query_buff, sizeof(query_buff),
                    "CREATE TEMPORARY TABLE %s SELECT * FROM %s WHERE 0",
                    result_table, result_table);
                    "SHOW FIELDS FROM %s", result_table);
        if (mysql_query_with_error_report(sock, 0, query_buff))
        {
          safe_exit(EX_MYSQLERR);
          DBUG_RETURN(0);
        }

        /* Get CREATE statement for the temp table */
        my_snprintf(query_buff, sizeof(query_buff), "SHOW CREATE TABLE %s",
                    result_table);
        if (mysql_query_with_error_report(sock, 0, query_buff))
        if ((result= mysql_store_result(sock)))
        {
          if (mysql_num_rows(result))
          {
          safe_exit(EX_MYSQLERR);
          DBUG_RETURN(0);
        }
        tableRes= mysql_store_result(sock);
        row= mysql_fetch_row(tableRes);

            if (opt_drop)
            {
              fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
                      opt_quoted_table);

        /* Print CREATE statement but remove TEMPORARY */
        fprintf(sql_file, "/*!50001 CREATE %s*/;\n", row[1]+17);
              check_io(sql_file);
            }

        mysql_free_result(tableRes);
            fprintf(sql_file, "/*!50001 CREATE TABLE %s (\n", result_table);
            /*
               Get first row, following loop will prepend comma - keeps
               from having to know if the row being printed is last to
               determine if there should be a _trailing_ comma.
            */
            row= mysql_fetch_row(result);

        /* Drop the temp table */
        my_snprintf(buff, sizeof(buff),
                    "DROP TEMPORARY TABLE %s", result_table);
        if (mysql_query_with_error_report(sock, 0, buff))
            fprintf(sql_file, "  %s %s", quote_name(row[0], name_buff, 0), row[1]);

            while((row= mysql_fetch_row(result)))
            {
          safe_exit(EX_MYSQLERR);
          DBUG_RETURN(0);
              /* col name, col type */
              fprintf(sql_file, ",\n  %s %s",
                      quote_name(row[0], name_buff, 0), row[1]);
            }
            fprintf(sql_file, "\n) */;\n");
            check_io(sql_file);
          }
        }
        mysql_free_result(result);

        was_views= 1;
        DBUG_RETURN(0);
      }
      row= mysql_fetch_row(tableRes);

      row= mysql_fetch_row(result);
      fprintf(sql_file, "%s;\n", row[1]);
      check_io(sql_file);
      mysql_free_result(tableRes);
      mysql_free_result(result);
    }
    my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
		result_table);
    if (mysql_query_with_error_report(sock, &tableRes, query_buff))
    if (mysql_query_with_error_report(sock, &result, query_buff))
    {
      if (path)
	my_fclose(sql_file, MYF(MY_WME));
@@ -1520,7 +1528,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
      }
    }

    while ((row=mysql_fetch_row(tableRes)))
    while ((row= mysql_fetch_row(result)))
    {
      if (complete_insert)
      {
@@ -1533,8 +1541,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
                      quote_name(row[SHOW_FIELDNAME], name_buff, 0));
      }
    }
    num_fields= (uint) mysql_num_rows(tableRes);
    mysql_free_result(tableRes);
    num_fields= mysql_num_rows(result);
    mysql_free_result(result);
  }
  else
  {
@@ -1545,7 +1553,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,

    my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
		result_table);
    if (mysql_query_with_error_report(sock, &tableRes, query_buff))
    if (mysql_query_with_error_report(sock, &result, query_buff))
    {
      safe_exit(EX_MYSQLERR);
      DBUG_RETURN(0);
@@ -1595,9 +1603,9 @@ static uint get_table_structure(char *table, char *db, char *table_type,
      }
    }

    while ((row=mysql_fetch_row(tableRes)))
    while ((row= mysql_fetch_row(result)))
    {
      ulong *lengths=mysql_fetch_lengths(tableRes);
      ulong *lengths= mysql_fetch_lengths(result);
      if (init)
      {
        if (!opt_xml && !tFlag)
@@ -1616,7 +1624,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
      {
	if (opt_xml)
	{
	  print_xml_row(sql_file, "field", tableRes, &row);
	  print_xml_row(sql_file, "field", result, &row);
	  continue;
	}

@@ -1640,15 +1648,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
	check_io(sql_file);
      }
    }
    num_fields = (uint) mysql_num_rows(tableRes);
    mysql_free_result(tableRes);
    num_fields= mysql_num_rows(result);
    mysql_free_result(result);
    if (!tFlag)
    {
      /* Make an sql-file, if path was given iow. option -T was given */
      char buff[20+FN_REFLEN];
      uint keynr,primary_key;
      my_snprintf(buff, sizeof(buff), "show keys from %s", result_table);
      if (mysql_query_with_error_report(sock, &tableRes, buff))
      if (mysql_query_with_error_report(sock, &result, buff))
      {
        if (mysql_errno(sock) == ER_WRONG_OBJECT)
        {
@@ -1667,7 +1675,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
      /* Find first which key is primary key */
      keynr=0;
      primary_key=INT_MAX;
      while ((row=mysql_fetch_row(tableRes)))
      while ((row= mysql_fetch_row(result)))
      {
        if (atoi(row[3]) == 1)
        {
@@ -1683,13 +1691,13 @@ static uint get_table_structure(char *table, char *db, char *table_type,
	  }
        }
      }
      mysql_data_seek(tableRes,0);
      mysql_data_seek(result,0);
      keynr=0;
      while ((row=mysql_fetch_row(tableRes)))
      while ((row= mysql_fetch_row(result)))
      {
	if (opt_xml)
	{
	  print_xml_row(sql_file, "key", tableRes, &row);
	  print_xml_row(sql_file, "key", result, &row);
	  continue;
	}

@@ -1730,7 +1738,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
        my_snprintf(buff, sizeof(buff), "show table status like %s",
		    quote_for_like(table, show_name_buff));

        if (mysql_query_with_error_report(sock, &tableRes, buff))
        if (mysql_query_with_error_report(sock, &result, buff))
        {
	  if (mysql_errno(sock) != ER_PARSE_ERROR)
	  {					/* If old MySQL version */
@@ -1740,7 +1748,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
		      result_table,mysql_error(sock));
	  }
        }
        else if (!(row=mysql_fetch_row(tableRes)))
        else if (!(row= mysql_fetch_row(result)))
        {
	  fprintf(stderr,
		  "Error: Couldn't read status information for table %s (%s)\n",
@@ -1749,18 +1757,18 @@ static uint get_table_structure(char *table, char *db, char *table_type,
        else
        {
	  if (opt_xml)
	    print_xml_row(sql_file, "options", tableRes, &row);
	    print_xml_row(sql_file, "options", result, &row);
	  else
	  {
	    fputs("/*!",sql_file);
	    print_value(sql_file,tableRes,row,"engine=","Engine",0);
	    print_value(sql_file,tableRes,row,"","Create_options",0);
	    print_value(sql_file,tableRes,row,"comment=","Comment",1);
	    print_value(sql_file,result,row,"engine=","Engine",0);
	    print_value(sql_file,result,row,"","Create_options",0);
	    print_value(sql_file,result,row,"comment=","Comment",1);
	    fputs(" */",sql_file);
	    check_io(sql_file);
	  }
        }
        mysql_free_result(tableRes);		/* Is always safe to free */
        mysql_free_result(result);		/* Is always safe to free */
      }
continue_xml:
      if (!opt_xml)
+6 −6
Original line number Diff line number Diff line
@@ -25,10 +25,10 @@
#endif

#ifdef  __cplusplus
#define EXTERN_C extern "C"
#define EXTERNC extern "C"
extern "C" {
#else
#define EXTERN_C
#define EXTERNC
#endif /* __cplusplus */ 

#if defined(__WIN__) || defined(OS2)
@@ -80,10 +80,10 @@ struct timespec { /* For pthread_cond_timedwait() */
typedef int pthread_mutexattr_t;
#define win_pthread_self my_thread_var->pthread_self
#ifdef OS2
#define pthread_handler_t EXTERN_C void * _Optlink
#define pthread_handler_t EXTERNC void * _Optlink
typedef void * (_Optlink *pthread_handler)(void *);
#else
#define pthread_handler_t EXTERN_C void * __cdecl
#define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
#endif

@@ -187,7 +187,7 @@ typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */
#define pthread_key_create(A,B) thr_keycreate((A),(B))
#define pthread_key_delete(A) thr_keydelete(A)

#define pthread_handler_t EXTERN_C void *
#define pthread_handler_t EXTERNC void *
#define pthread_key(T,V) pthread_key_t V

void *	my_pthread_getspecific_imp(pthread_key_t key);
@@ -265,7 +265,7 @@ extern int my_pthread_getprio(pthread_t thread_id);
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
#define pthread_detach_this_thread()
#define pthread_handler_t EXTERN_C void *
#define pthread_handler_t EXTERNC void *
typedef void *(* pthread_handler)(void *);

/* Test first for RTS or FSU threads */
+181 −0
Original line number Diff line number Diff line
source include/have_geometry.inc;
--source include/have_ndb.inc

#
# Spatial objects
#

--disable_warnings
DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
--enable_warnings

CREATE TABLE gis_point  (fid INTEGER, g POINT);
CREATE TABLE gis_line  (fid INTEGER, g LINESTRING);
CREATE TABLE gis_polygon   (fid INTEGER, g POLYGON);
CREATE TABLE gis_multi_point (fid INTEGER, g MULTIPOINT);
CREATE TABLE gis_multi_line (fid INTEGER, g MULTILINESTRING);
CREATE TABLE gis_multi_polygon  (fid INTEGER, g MULTIPOLYGON);
CREATE TABLE gis_geometrycollection  (fid INTEGER, g GEOMETRYCOLLECTION);
CREATE TABLE gis_geometry (fid INTEGER, g GEOMETRY);

SHOW CREATE TABLE gis_point;
SHOW FIELDS FROM gis_point;
SHOW FIELDS FROM gis_line;
SHOW FIELDS FROM gis_polygon;
SHOW FIELDS FROM gis_multi_point;
SHOW FIELDS FROM gis_multi_line;
SHOW FIELDS FROM gis_multi_polygon;
SHOW FIELDS FROM gis_geometrycollection;
SHOW FIELDS FROM gis_geometry;


INSERT INTO gis_point VALUES 
(101, PointFromText('POINT(10 10)')),
(102, PointFromText('POINT(20 10)')),
(103, PointFromText('POINT(20 20)')),
(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));

INSERT INTO gis_line VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));

INSERT INTO gis_polygon VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));

INSERT INTO gis_multi_point VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));

INSERT INTO gis_multi_line VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));


INSERT INTO gis_multi_polygon VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));

INSERT INTO gis_geometrycollection VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));

INSERT into gis_geometry SELECT * FROM gis_point;
INSERT into gis_geometry SELECT * FROM gis_line;
INSERT into gis_geometry SELECT * FROM gis_polygon;
INSERT into gis_geometry SELECT * FROM gis_multi_point;
INSERT into gis_geometry SELECT * FROM gis_multi_line;
INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
INSERT into gis_geometry SELECT * FROM gis_geometrycollection;

SELECT fid, AsText(g) FROM gis_point ORDER by fid;
SELECT fid, AsText(g) FROM gis_line ORDER by fid;
SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;

SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;

SELECT fid, X(g) FROM gis_point ORDER by fid;
SELECT fid, Y(g) FROM gis_point ORDER by fid;
explain extended select X(g),Y(g) FROM gis_point;

SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
SELECT fid, GLength(g) FROM gis_line ORDER by fid;
SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;

SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;

SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;

SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;

SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
explain extended SELECT fid, NumGeometries(g) from gis_multi_point;

SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;

SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
explain extended SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;

DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;

#
# Check that ALTER TABLE doesn't loose geometry type
#
CREATE TABLE t1 (
  gp  point,
  ln  linestring,
  pg  polygon,
  mp  multipoint,
  mln multilinestring,
  mpg multipolygon,
  gc  geometrycollection,
  gm  geometry
);

SHOW FIELDS FROM t1;
ALTER TABLE t1 ADD fid INT;
SHOW FIELDS FROM t1;
DROP TABLE t1;

create table t1 (a geometry not null);
insert into t1 values (GeomFromText('Point(1 2)'));
-- error 1416
insert into t1 values ('Garbage');
-- error 1416
insert IGNORE into t1 values ('Garbage');

drop table t1;

create table t1 (fl geometry);
--error 1416
insert into t1 values (1);
--error 1416
insert into t1 values (1.11);
--error 1416
insert into t1 values ("qwerty");
--error 1416
insert into t1 values (pointfromtext('point(1,1)'));

drop table t1;

# End of 5.0 tests
+19 −0
Original line number Diff line number Diff line
@@ -216,6 +216,25 @@ NDBCLUSTER_PORT=9350
MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd
MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
MYSQL_MANAGER_USER=root

#
# To make it easier for different devs to work on the same host,
# an environment variable can be used to control all ports. A small
# number is to be used, 0 - 16 or similar.
#
if [ -n "$MTR_BUILD_THREAD" ] ; then
  MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 40 + 8120`
  MYSQL_MANAGER_PORT=`expr $MASTER_MYPORT + 2`
  SLAVE_MYPORT=`expr $MASTER_MYPORT + 16`
  NDBCLUSTER_PORT=`expr $MASTER_MYPORT + 24`

  echo "Using MTR_BUILD_THREAD   = $MTR_BUILD_THREAD"
  echo "Using MASTER_MYPORT      = $MASTER_MYPORT"
  echo "Using MYSQL_MANAGER_PORT = $MYSQL_MANAGER_PORT"
  echo "Using SLAVE_MYPORT       = $SLAVE_MYPORT"
  echo "Using NDBCLUSTER_PORT    = $NDBCLUSTER_PORT"
fi

NO_SLAVE=0
USER_TEST=
FAILED_CASES=
Loading