mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
bzr merge -r4346 maria/10.0 (maria-10.0.13)
This commit is contained in:
161
mysql-test/include/gis_debug.inc
Normal file
161
mysql-test/include/gis_debug.inc
Normal file
@@ -0,0 +1,161 @@
|
||||
#
|
||||
# This is a shared file included from t/gis-precise.test and t/gis-debug.test
|
||||
#
|
||||
# - gis-precise.test is executed both in debug and production builds
|
||||
# and makes sure that the checked GIS functions return the expected results.
|
||||
#
|
||||
# - gis-debug.test is executed only in debug builds
|
||||
# (and is skipped in production builds).
|
||||
# gis-debug.test activates tracing of the internal GIS routines.
|
||||
# The trace log is printed to the client side warnings.
|
||||
# So gis-debug.test makes sure not only that the correct results are returned,
|
||||
# but also check *how* these results were generated - makes sure that
|
||||
# the internal GIS routines went through the expected data and code flow paths.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
|
||||
BEGIN
|
||||
DECLARE g GEOMETRY;
|
||||
SET g=GeomFromText(geom);
|
||||
SELECT geom AS `-----`;
|
||||
SELECT dist, GeometryType(@buf:=ST_Buffer(g, dist)) AS `buffer`, ROUND(ST_AREA(@buf),2) AS buf_area;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
--disable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # Testing ST_BUFFER with positive distance
|
||||
--echo #
|
||||
|
||||
CALL p1(1, 'POINT(0 0))');
|
||||
CALL p1(1, 'LineString(0 1, 1 1))');
|
||||
CALL p1(1, 'LineString(9 9,8 1,1 5,0 0)');
|
||||
CALL p1(1, 'Polygon((2 2,2 8,8 8,8 2,2 2))');
|
||||
CALL p1(1, 'Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))');
|
||||
CALL p1(1, 'Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))');
|
||||
CALL p1(1, 'MultiPoint(9 9,8 1,1 5)');
|
||||
CALL p1(1, 'MultiLineString((0 0,2 2))');
|
||||
CALL p1(1, 'MultiLineString((0 0,2 2,0 4))');
|
||||
CALL p1(1, 'MultiLineString((0 0,2 2),(0 2,2 0))');
|
||||
CALL p1(1, 'MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))');
|
||||
CALL p1(1, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))');
|
||||
CALL p1(1, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))');
|
||||
CALL p1(1, 'GeometryCollection(Point(0 0))');
|
||||
CALL p1(1, 'GeometryCollection(LineString(0 0, 2 2)))');
|
||||
CALL p1(1, 'GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))');
|
||||
CALL p1(1, 'GeometryCollection(MultiPoint(9 9,8 1,1 5))');
|
||||
CALL p1(1, 'GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))');
|
||||
CALL p1(1, 'GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))');
|
||||
CALL p1(1, 'GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))');
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing ST_BUFFER with zero distance
|
||||
--echo #
|
||||
|
||||
CALL p1(0, 'POINT(0 0))');
|
||||
CALL p1(0, 'LineString(0 1, 1 1))');
|
||||
CALL p1(0, 'LineString(9 9,8 1,1 5,0 0)');
|
||||
CALL p1(0, 'Polygon((2 2,2 8,8 8,8 2,2 2))');
|
||||
CALL p1(0, 'Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))');
|
||||
CALL p1(0, 'Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))');
|
||||
CALL p1(0, 'MultiPoint(9 9,8 1,1 5)');
|
||||
CALL p1(0, 'MultiLineString((0 0,2 2))');
|
||||
CALL p1(0, 'MultiLineString((0 0,2 2,0 4))');
|
||||
CALL p1(0, 'MultiLineString((0 0,2 2),(0 2,2 0))');
|
||||
CALL p1(0, 'MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))');
|
||||
CALL p1(0, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))');
|
||||
CALL p1(0, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))');
|
||||
CALL p1(0, 'GeometryCollection(Point(0 0))');
|
||||
CALL p1(0, 'GeometryCollection(LineString(0 0, 2 2)))');
|
||||
CALL p1(0, 'GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))');
|
||||
CALL p1(0, 'GeometryCollection(MultiPoint(9 9,8 1,1 5))');
|
||||
CALL p1(0, 'GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))');
|
||||
CALL p1(0, 'GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))');
|
||||
CALL p1(0, 'GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))');
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing ST_BUFFER with negative distance
|
||||
--echo #
|
||||
|
||||
CALL p1(-1, 'POINT(0 0))');
|
||||
CALL p1(-1, 'LineString(0 1, 1 1))');
|
||||
CALL p1(-1, 'LineString(9 9,8 1,1 5,0 0)');
|
||||
CALL p1(-1, 'Polygon((2 2,2 8,8 8,8 2,2 2))');
|
||||
#
|
||||
# Wrong shape
|
||||
# CALL p1(-1, 'Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))');
|
||||
# Wrong shape
|
||||
# CALL p1(-1, 'Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))');
|
||||
#
|
||||
CALL p1(-1, 'MultiPoint(9 9,8 1,1 5)');
|
||||
CALL p1(-1, 'MultiLineString((0 0,2 2))');
|
||||
CALL p1(-1, 'MultiLineString((0 0,2 2,0 4))');
|
||||
CALL p1(-1, 'MultiLineString((0 0,2 2),(0 2,2 0))');
|
||||
CALL p1(-1, 'MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))');
|
||||
#
|
||||
# Wrong shape
|
||||
#CALL p1(-1, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))');
|
||||
#CALL p1(-1, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))');
|
||||
#
|
||||
CALL p1(-1, 'GeometryCollection(Point(0 0))');
|
||||
CALL p1(-1, 'GeometryCollection(LineString(0 0, 2 2)))');
|
||||
CALL p1(-1, 'GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))');
|
||||
CALL p1(-1, 'GeometryCollection(MultiPoint(9 9,8 1,1 5))');
|
||||
CALL p1(-1, 'GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))');
|
||||
#
|
||||
# Wrong shape
|
||||
# CALL p1(-1, 'GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))');
|
||||
#
|
||||
CALL p1(-1, 'GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))');
|
||||
|
||||
|
||||
--enable_query_log
|
||||
|
||||
SELECT ST_CONTAINS(
|
||||
GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
|
||||
GeomFromText('POINT(5 10)'));
|
||||
SELECT AsText(ST_UNION(
|
||||
GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
|
||||
GeomFromText('POINT(5 10)')));
|
||||
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #13833019 ASSERTION `T1->RESULT_RANGE' FAILED IN GCALC_OPERATION_REDUCER::END_COUPLE
|
||||
--echo #
|
||||
SELECT GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,9 4,3 3,0 0)),((2 2,2 2,8 8,2 3,2 2)))'), 3));
|
||||
|
||||
--echo #
|
||||
--echo # Bug #13832749 HANDLE_FATAL_SIGNAL IN GCALC_FUNCTION::COUNT_INTERNAL
|
||||
--echo #
|
||||
SELECT GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), ((9 9,8 1,1 5,9 9)))'),1));
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#13358363 - ASSERTION: N > 0 && N < SINUSES_CALCULATED*2+1 | GET_N_SINCOS/ADD_EDGE_BUFFER
|
||||
--echo #
|
||||
|
||||
DO ST_BUFFER(ST_GEOMCOLLFROMTEXT('linestring(1 1,2 2)'),'');
|
||||
|
||||
SELECT ST_WITHIN(
|
||||
LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
|
||||
ST_BUFFER(MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)),((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5))) '),
|
||||
ST_NUMINTERIORRINGS(POLYGONFROMTEXT('POLYGON((3 5,2 4,2 5,3 5)) '))));
|
||||
|
||||
SELECT ST_DIMENSION(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((3 5,2 5,2 4,3 4,3 5)) '),
|
||||
ST_NUMINTERIORRINGS(POLYGONFROMTEXT(' POLYGON((0 0,9 3,4 2,0 0))'))));
|
||||
|
||||
SELECT ST_NUMINTERIORRINGS(
|
||||
ST_ENVELOPE(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5))) '),
|
||||
SRID(MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 2,4 2,1 2,2 4,2 2)) ')))));
|
||||
|
||||
SELECT ASTEXT(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'),
|
||||
SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) '))));
|
@@ -72,6 +72,19 @@ 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;
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE gis_point;
|
||||
ANALYZE TABLE gis_line;
|
||||
ANALYZE TABLE gis_polygon;
|
||||
ANALYZE TABLE gis_multi_point;
|
||||
ANALYZE TABLE gis_multi_line;
|
||||
ANALYZE TABLE gis_multi_polygon;
|
||||
ANALYZE TABLE gis_geometrycollection;
|
||||
ANALYZE TABLE gis_geometry;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
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;
|
||||
|
@@ -1,4 +0,0 @@
|
||||
--require r/have_mysql_upgrade.result
|
||||
--disable_query_log
|
||||
select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
|
||||
--enable_query_log
|
15
mysql-test/include/have_semisync_plugin.inc
Normal file
15
mysql-test/include/have_semisync_plugin.inc
Normal file
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Check if server has support for loading plugins
|
||||
#
|
||||
if (`SELECT @@have_dynamic_loading != 'YES'`) {
|
||||
--skip Requires dynamic loading
|
||||
}
|
||||
|
||||
#
|
||||
# Check if the variable SEMISYNC_MASTER_SO is set
|
||||
#
|
||||
if (!$SEMISYNC_MASTER_SO)
|
||||
{
|
||||
skip Need semisync plugins;
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
if ($value == No such row)
|
||||
{
|
||||
SET sql_log_bin = 0;
|
||||
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
|
||||
install plugin rpl_semi_sync_master soname 'semisync_master';
|
||||
SET GLOBAL rpl_semi_sync_master_enabled = 1;
|
||||
SET sql_log_bin = 1;
|
||||
}
|
||||
@@ -28,7 +28,7 @@ if ($value == No such row)
|
||||
if ($value == No such row)
|
||||
{
|
||||
SET sql_log_bin = 0;
|
||||
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
|
||||
install plugin rpl_semi_sync_slave soname 'semisync_slave';
|
||||
SET GLOBAL rpl_semi_sync_slave_enabled = 1;
|
||||
SET sql_log_bin = 1;
|
||||
}
|
||||
|
@@ -159,6 +159,7 @@ INSERT INTO global_suppressions VALUES
|
||||
("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"),
|
||||
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
|
||||
("InnoDB: Error: table `test`.`t[123]` .*does not exist in the InnoDB internal"),
|
||||
("InnoDB: Warning: semaphore wait:"),
|
||||
|
||||
/*
|
||||
BUG#32080 - Excessive warnings on Solaris: setrlimit could not
|
||||
|
@@ -2,13 +2,6 @@
|
||||
|
||||
# Can't run test of external client with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# Only run test if "mysql_upgrade" is found
|
||||
--require r/have_mysql_upgrade.result
|
||||
--disable_query_log
|
||||
select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# Hack:
|
||||
#
|
||||
|
@@ -10,6 +10,10 @@
|
||||
# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set
|
||||
# before sourcing this routine.
|
||||
#
|
||||
# Optionally, SEARCH_RANGE can be set to the max number of bytes of the file
|
||||
# to search. If negative, it will search that many bytes at the end of the
|
||||
# file. The default is to search only the first 50000 bytes of the file.
|
||||
#
|
||||
# In case of
|
||||
# - SEARCH_FILE and/or SEARCH_PATTERN is not set
|
||||
# - SEARCH_FILE cannot be opened
|
||||
@@ -38,6 +42,7 @@
|
||||
# --error 0,1
|
||||
# --remove_file $error_log
|
||||
# let SEARCH_FILE= $error_log;
|
||||
# let SEARCH_RANGE= -50000;
|
||||
# # Stop the server
|
||||
# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
|
||||
# --exec echo "wait" > $restart_file
|
||||
@@ -57,8 +62,18 @@ perl;
|
||||
use strict;
|
||||
my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
|
||||
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
|
||||
my $search_range= $ENV{'SEARCH_RANGE'};
|
||||
my $file_content;
|
||||
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
|
||||
open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n");
|
||||
read(FILE, my $file_content, 50000, 0);
|
||||
if ($search_range >= 0) {
|
||||
read(FILE, $file_content, $search_range, 0);
|
||||
} else {
|
||||
my $size= -s $search_file;
|
||||
$search_range = -$size if $size > -$search_range;
|
||||
seek(FILE, $search_range, 2);
|
||||
read(FILE, $file_content, -$search_range, 0);
|
||||
}
|
||||
close(FILE);
|
||||
if ( not $file_content =~ m{$search_pattern} ) {
|
||||
die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n");
|
||||
|
@@ -83,7 +83,7 @@ let $script=
|
||||
s{block_len=[0-9]+}{block_len=#};
|
||||
s{Server ver:.*DOLLAR}{SERVER_VERSION, BINLOG_VERSION};
|
||||
s{GTID [0-9]+-[0-9]+-[0-9]+}{GTID #-#-#};
|
||||
s{\[[0-9]-[0-9]-[0-9]+\]}{[#-#-#]};
|
||||
s{\[([0-9]-[0-9]-[0-9]+,?)+\]}{[#-#-#]};
|
||||
s{cid=[0-9]+}{cid=#};
|
||||
s{SQL_LOAD-[a-z,0-9,-]*.[a-z]*}{SQL_LOAD-<SERVER UUID>-<MASTER server-id>-<file-id>.<extension>};
|
||||
s{rand_seed1=[0-9]*,rand_seed2=[0-9]*}{rand_seed1=<seed 1>,rand_seed2=<seed 2>};
|
||||
|
32
mysql-test/include/stop_dump_threads.inc
Normal file
32
mysql-test/include/stop_dump_threads.inc
Normal file
@@ -0,0 +1,32 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Stop all dump threads on the server of the current connection.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# --source include/stop_dump_threads.inc
|
||||
|
||||
--let $include_filename= stop_dump_threads.inc
|
||||
--source include/begin_include_file.inc
|
||||
|
||||
|
||||
--let $_sdt_show_rpl_debug_info_old= $show_rpl_debug_info
|
||||
--let $show_rpl_debug_info= 1
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
|
||||
--let $_sdt_dump_thread_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump'`
|
||||
|
||||
while ($_sdt_dump_thread_id != '')
|
||||
{
|
||||
eval KILL $_sdt_dump_thread_id;
|
||||
--let $wait_condition= SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = $_sdt_dump_thread_id
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $_sdt_dump_thread_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump'`
|
||||
}
|
||||
|
||||
--let $show_rpl_debug_info= $_sdt_show_rpl_debug_info_old
|
||||
|
||||
--let $include_filename= stop_dump_threads.inc
|
||||
--source include/end_include_file.inc
|
@@ -13,6 +13,11 @@
|
||||
UNINSTALL PLUGIN rpl_semi_sync_slave;
|
||||
|
||||
--connection master
|
||||
# After BUG#17638477 fix, uninstallation of rpl_semi_sync_master
|
||||
# is not allowed when there are semi sync slaves. Hence kill
|
||||
# all dump threads before uninstalling it.
|
||||
SET GLOBAL rpl_semi_sync_master_enabled = OFF;
|
||||
--source include/stop_dump_threads.inc
|
||||
UNINSTALL PLUGIN rpl_semi_sync_master;
|
||||
--enable_warnings
|
||||
|
||||
|
Reference in New Issue
Block a user