diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-31 11:05:21 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-31 11:05:21 +0300 |
commit | 5eae8c274244aaa98320dda3e686f264e8a447d6 (patch) | |
tree | d99f593c55e008af4df649ff456868724e7f2d32 /mysql-test | |
parent | bf310b4cfb5c275f8c555d469ef310bdd1219920 (diff) | |
parent | 8341f582b2fe864027954282f96fb84e560cae72 (diff) | |
download | mariadb-git-5eae8c274244aaa98320dda3e686f264e8a447d6.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'mysql-test')
19 files changed, 295 insertions, 37 deletions
diff --git a/mysql-test/main/gis-json.result b/mysql-test/main/gis-json.result index d507a9994ff..e52a7c809c6 100644 --- a/mysql-test/main/gis-json.result +++ b/mysql-test/main/gis-json.result @@ -62,9 +62,9 @@ SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}')) GEOMETRYCOLLECTION(POINT(102 0.5)) SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',5)); -ERROR HY000: Incorrect option value: '5' for function ST_GeometryFromJSON +ERROR HY000: Incorrect option value: '5' for function ST_GeomFromGeoJSON SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',1)); -ERROR 22023: Invalid GIS data provided to function ST_GeometryFromJSON. +ERROR 22023: Invalid GIS data provided to function ST_GeomFromGeoJSON. SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',2)); ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',2)) POINT(5.3 15) diff --git a/mysql-test/main/gis-precise.result b/mysql-test/main/gis-precise.result index 4e4161c34ec..513d8b6e8c2 100644 --- a/mysql-test/main/gis-precise.result +++ b/mysql-test/main/gis-precise.result @@ -806,3 +806,114 @@ SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) ')))); 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) ')))) POLYGON((9 9,5 2,4 5,9 9)) +# +# MDEV-13467 Feature request: Support for ST_Distance_Sphere() +# +SELECT ST_DISTANCE_SPHERE(); +ERROR 42000: Incorrect parameter count in the call to native function 'ST_DISTANCE_SPHERE' +SELECT ST_DISTANCE_SPHERE(NULL); +ERROR 42000: Incorrect parameter count in the call to native function 'ST_DISTANCE_SPHERE' +SELECT ST_DISTANCE_SPHERE(NULL, NULL); +ST_DISTANCE_SPHERE(NULL, NULL) +NULL +SELECT ST_DISTANCE_SPHERE(NULL, NULL, 3); +ST_DISTANCE_SPHERE(NULL, NULL, 3) +NULL +SELECT ST_DISTANCE_SPHERE(NULL, 1, 3); +ST_DISTANCE_SPHERE(NULL, 1, 3) +NULL +SELECT ST_DISTANCE_SPHERE(1, NULL, 3); +ST_DISTANCE_SPHERE(1, NULL, 3) +NULL +SELECT ST_DISTANCE_SPHERE(1, 1); +ERROR 22023: Invalid GIS data provided to function ST_Distance_Sphere. +SELECT ST_DISTANCE_SPHERE(1, 1, 3); +ERROR 22023: Invalid GIS data provided to function ST_Distance_Sphere. +SELECT ST_DISTANCE_SPHERE(1, 1, NULL); +ST_DISTANCE_SPHERE(1, 1, NULL) +NULL +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)')); +ERROR HY000: Internal error: st_distance_sphere +# Test Points and radius +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)')) +157249.0357231545 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-1 -1)'), ST_GEOMFROMTEXT('POINT(-2 -2)')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-1 -1)'), ST_GEOMFROMTEXT('POINT(-2 -2)')), 10) +157225.0865419108 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 1) +0.024682056391766436 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 0); +ERROR HY000: Internal error: Radius must be greater than zero. +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), -1); +ERROR HY000: Internal error: Radius must be greater than zero. +# Test longitude/lattitude +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10) +157225.0865419108 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(2 1)')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(2 1)')), 10) +222355.4901806686 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10) +222389.3645969269 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(2 1)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(2 1)')) +157249.0357231545 +# Test Points - Multipoints +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1)')) +157249.0357231545 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)')) +157249.0357231545 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)')) +157249.0357231545 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)')) +157249.0357231545 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)'), 1) +0.024682056391766436 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)'), 1) +0.024682056391766436 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1, 3 4)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1, 3 4)'), 1) +0.024682056391766436 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1,5 6)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1,5 6)'), 1) +0.024682056391766436 +# Test Multipoints - Multipoints +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')) +0 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')), 10) +314282.5644496733 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )')), 10) +314282.5644496733 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),1), 17); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),1), 17) +0.04933028646581131 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),0); +ERROR HY000: Internal error: Radius must be greater than zero. +set @pt1 = ST_GeomFromText('POINT(190 -30)'); +set @pt2 = ST_GeomFromText('POINT(-30 50)'); +SELECT ST_Distance_Sphere(@pt1, @pt2); +ERROR HY000: Out of range error: Longitude should be [-180,180] in function ST_Distance_Sphere. +set @pt1 = ST_GeomFromText('POINT(135 -30)'); +set @pt2 = ST_GeomFromText('POINT(-30 91)'); +SELECT ST_Distance_Sphere(@pt1, @pt2); +ERROR HY000: Out of range error: Latitude should be [-90,90] in function ST_Distance_Sphere. +set @zenica = ST_GeomFromText('POINT(17.907743 44.203438)'); +set @sarajevo = ST_GeomFromText('POINT(18.413076 43.856258)'); +SELECT TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10); +TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10) +55878.5933759170 +SELECT TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10); +TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10) +55878.5933759170 diff --git a/mysql-test/main/gis-precise.test b/mysql-test/main/gis-precise.test index 24f4ac9113e..da72a0c4d8a 100644 --- a/mysql-test/main/gis-precise.test +++ b/mysql-test/main/gis-precise.test @@ -394,3 +394,81 @@ with cte1 as( select (st_symdifference(point(1,1),point(1,1))) as a1 ), cte2 a --source include/gis_debug.inc + +--echo # +--echo # MDEV-13467 Feature request: Support for ST_Distance_Sphere() +--echo # + +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT ST_DISTANCE_SPHERE(); +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT ST_DISTANCE_SPHERE(NULL); +SELECT ST_DISTANCE_SPHERE(NULL, NULL); +# NULL args and optional radius will return NULL +SELECT ST_DISTANCE_SPHERE(NULL, NULL, 3); +# At least 1 NULL arg and optional radius will return NULL +SELECT ST_DISTANCE_SPHERE(NULL, 1, 3); +# At least 1 NULL arg and optional radius will return NULL +SELECT ST_DISTANCE_SPHERE(1, NULL, 3); +# Return ER_GIS_INVALID_DATA for invalid geometry +--error ER_GIS_INVALID_DATA +SELECT ST_DISTANCE_SPHERE(1, 1); +--error ER_GIS_INVALID_DATA +SELECT ST_DISTANCE_SPHERE(1, 1, 3); +# Return NULL if radius is NULL +SELECT ST_DISTANCE_SPHERE(1, 1, NULL); +# Wrong geometry +--error ER_INTERNAL_ERROR +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)')); + +--echo # Test Points and radius +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)')); +# make bb x86 happy +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-1 -1)'), ST_GEOMFROMTEXT('POINT(-2 -2)')), 10); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 1); +--error ER_INTERNAL_ERROR +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 0); +--error ER_INTERNAL_ERROR +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), -1); +--echo # Test longitude/lattitude +# make bb x86 happy +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10); +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(2 1)')), 10); +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(2 1)')); +--echo # Test Points - Multipoints +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1)')); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)')); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)')); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)')); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)'), 1); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)'), 1); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1, 3 4)'), 1); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1,5 6)'), 1); +--echo # Test Multipoints - Multipoints +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')); +# make bb x86 happy +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')), 10); +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )')), 10); +# make bb x86 happy +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),1), 17); +--error ER_INTERNAL_ERROR +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),0); + +# Longitude out of range [-180,180] +set @pt1 = ST_GeomFromText('POINT(190 -30)'); +set @pt2 = ST_GeomFromText('POINT(-30 50)'); +--error ER_STD_OUT_OF_RANGE_ERROR +SELECT ST_Distance_Sphere(@pt1, @pt2); + +# Latitude out of range [-90, 90] +set @pt1 = ST_GeomFromText('POINT(135 -30)'); +set @pt2 = ST_GeomFromText('POINT(-30 91)'); +--error ER_STD_OUT_OF_RANGE_ERROR +SELECT ST_Distance_Sphere(@pt1, @pt2); + +# POINT in form (longitude[-180, 180] latitude[-90, 90]) +set @zenica = ST_GeomFromText('POINT(17.907743 44.203438)'); +set @sarajevo = ST_GeomFromText('POINT(18.413076 43.856258)'); +SELECT TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10); +SELECT TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10); diff --git a/mysql-test/main/userstat.test b/mysql-test/main/userstat.test index 42fe1c2ad17..cc7ddd58e11 100644 --- a/mysql-test/main/userstat.test +++ b/mysql-test/main/userstat.test @@ -5,6 +5,7 @@ -- source include/have_innodb.inc -- source include/have_log_bin.inc +-- source include/have_perfschema.inc select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key; show columns from information_schema.client_statistics; diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.test b/mysql-test/suite/binlog/t/binlog_xa_recover.test index 51c30ee705d..3b2a7e45392 100644 --- a/mysql-test/suite/binlog/t/binlog_xa_recover.test +++ b/mysql-test/suite/binlog/t/binlog_xa_recover.test @@ -8,6 +8,7 @@ --source include/have_debug.inc --source include/have_debug_sync.inc --source include/have_binlog_format_row.inc +--source include/have_perfschema.inc # Valgrind does not work well with test that crashes the server --source include/not_valgrind.inc diff --git a/mysql-test/suite/encryption/t/innodb-discard-import-change.combinations b/mysql-test/suite/encryption/t/innodb-discard-import-change.combinations new file mode 100644 index 00000000000..729380593f3 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-discard-import-change.combinations @@ -0,0 +1,5 @@ +[strict_crc32] +--innodb-checksum-algorithm=strict_crc32 + +[strict_full_crc32] +--innodb-checksum-algorithm=strict_full_crc32 diff --git a/mysql-test/suite/encryption/t/innodb-discard-import.combinations b/mysql-test/suite/encryption/t/innodb-discard-import.combinations new file mode 100644 index 00000000000..729380593f3 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-discard-import.combinations @@ -0,0 +1,5 @@ +[strict_crc32] +--innodb-checksum-algorithm=strict_crc32 + +[strict_full_crc32] +--innodb-checksum-algorithm=strict_full_crc32 diff --git a/mysql-test/suite/galera/r/galera_ssl_upgrade.result b/mysql-test/suite/galera/r/galera_ssl_upgrade.result index 818469bf6ad..8aab135c6a2 100644 --- a/mysql-test/suite/galera/r/galera_ssl_upgrade.result +++ b/mysql-test/suite/galera/r/galera_ssl_upgrade.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown"); SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; VARIABLE_VALUE = 'Synced' 1 diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.test b/mysql-test/suite/galera/t/galera_ssl_upgrade.test index 3adb208e442..146a0126f1f 100644 --- a/mysql-test/suite/galera/t/galera_ssl_upgrade.test +++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.test @@ -8,6 +8,8 @@ --source include/have_innodb.inc --source include/have_ssl_communication.inc +call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown"); + SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; diff --git a/mysql-test/suite/innodb_fts/r/misc_debug.result b/mysql-test/suite/innodb_fts/r/misc_debug.result index f1110797f33..10e3cf8874d 100644 --- a/mysql-test/suite/innodb_fts/r/misc_debug.result +++ b/mysql-test/suite/innodb_fts/r/misc_debug.result @@ -26,3 +26,29 @@ SET DEBUG_DBUG="+d,fts_instrument_sync"; INSERT INTO t1 VALUES(1, "mariadb"); ALTER TABLE t1 FORCE; DROP TABLE t2, t1; +# +# MDEV-25200 Index count mismatch due to aborted FULLTEXT INDEX +# +CREATE TABLE t1(a INT, b TEXT, c TEXT, FULLTEXT INDEX(b)) ENGINE=InnoDB; +connect con1,localhost,root,,test; +SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL s1 WAIT_FOR g1'; +SET DEBUG_SYNC='innodb_commit_inplace_alter_table_enter SIGNAL s2 WAIT_FOR g2'; +ALTER TABLE t1 ADD FULLTEXT(c); +connection default; +SET DEBUG_SYNC='now WAIT_FOR s1'; +KILL QUERY @id; +SET DEBUG_SYNC='now SIGNAL g1 WAIT_FOR s2'; +START TRANSACTION; +SELECT * FROM t1; +a b c +SET DEBUG_SYNC='now SIGNAL s2'; +connection con1; +ERROR 70100: Query execution was interrupted +disconnect con1; +connection default; +SET DEBUG_SYNC=RESET; +ALTER TABLE t1 ADD bl INT AS (LENGTH(b)) VIRTUAL; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_fts/t/misc_debug.test b/mysql-test/suite/innodb_fts/t/misc_debug.test index aaf628abe6d..461e3f1d9d4 100644 --- a/mysql-test/suite/innodb_fts/t/misc_debug.test +++ b/mysql-test/suite/innodb_fts/t/misc_debug.test @@ -5,6 +5,8 @@ --source include/have_innodb.inc --source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/count_sessions.inc # Following test is for Bug 14668777 - ASSERT ON IB_VECTOR_SIZE( # TABLE->FTS->INDEXES, ALTER TABLE @@ -52,3 +54,32 @@ INSERT INTO t1 VALUES(1, "mariadb"); ALTER TABLE t1 FORCE; # Cleanup DROP TABLE t2, t1; + +--echo # +--echo # MDEV-25200 Index count mismatch due to aborted FULLTEXT INDEX +--echo # +CREATE TABLE t1(a INT, b TEXT, c TEXT, FULLTEXT INDEX(b)) ENGINE=InnoDB; +connect(con1,localhost,root,,test); +let $ID= `SELECT @id := CONNECTION_ID()`; +SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL s1 WAIT_FOR g1'; +SET DEBUG_SYNC='innodb_commit_inplace_alter_table_enter SIGNAL s2 WAIT_FOR g2'; +send ALTER TABLE t1 ADD FULLTEXT(c); +connection default; +SET DEBUG_SYNC='now WAIT_FOR s1'; +let $ignore= `SELECT @id := $ID`; +KILL QUERY @id; +SET DEBUG_SYNC='now SIGNAL g1 WAIT_FOR s2'; +START TRANSACTION; +SELECT * FROM t1; +SET DEBUG_SYNC='now SIGNAL s2'; +connection con1; +--error ER_QUERY_INTERRUPTED +reap; +disconnect con1; +connection default; +SET DEBUG_SYNC=RESET; +# Exploit MDEV-17468 to force the table definition to be reloaded +ALTER TABLE t1 ADD bl INT AS (LENGTH(b)) VIRTUAL; +CHECK TABLE t1; +DROP TABLE t1; +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/innodb_gis/t/1.test b/mysql-test/suite/innodb_gis/t/1.test index 7c9199c59ae..f08fdaddbda 100644 --- a/mysql-test/suite/innodb_gis/t/1.test +++ b/mysql-test/suite/innodb_gis/t/1.test @@ -393,7 +393,6 @@ insert into t1 values (1); insert into t1 values (1.11); --error 1416 insert into t1 values ("qwerty"); -# --error ER_GIS_INVALID_DATA --error ER_BAD_NULL_ERROR insert into t1 values (ST_pointfromtext('point(1,1)')); @@ -437,7 +436,6 @@ select ST_y(b) IS NULL from t1; -# --error ER_GIS_INVALID_DATA select MBRwithin(b, b) IS NULL, MBRcontains(b, b) IS NULL, MBRoverlaps(b, b) IS NULL, MBRequals(b, b) IS NULL, MBRdisjoint(b, b) IS NULL, ST_touches(b, b) IS NULL, @@ -466,7 +464,6 @@ DROP TABLE t1; # CREATE TABLE `t1` ( `col9` set('a'), `col89` date); INSERT IGNORE INTO `t1` VALUES ('','0000-00-00'); -# --error ER_GIS_INVALID_DATA select ST_geomfromtext(col9,col89) as a from t1; DROP TABLE t1; @@ -623,17 +620,11 @@ SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRwithin FROM t1 a1 JOIN # MBROverlaps needs a few more tests, with point and line dimensions -# --error ER_GIS_INVALID_DATA SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); -# --error ER_GIS_INVALID_DATA SET @horiz1 = ST_GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz2 = ST_GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz3 = ST_GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); -# --error ER_GIS_INVALID_DATA SET @point1 = ST_GeomFromText('POLYGON ((0 0))'); -# --error ER_GIS_INVALID_DATA SET @point2 = ST_GeomFromText('POLYGON ((-2 0))'); SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS MBRoverlaps FROM t1 a1 WHERE MBROverlaps(a1.square, @vert1) GROUP BY a1.name; @@ -773,10 +764,8 @@ SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUA --echo # BUG#51875: crash when loading data into geometry function ST_polyfromwkb --echo # SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; -# --error ER_GIS_INVALID_DATA SET @a=ST_POLYFROMWKB(@a); SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; -# --error ER_GIS_INVALID_DATA SET @a=ST_POLYFROMWKB(@a); @@ -901,7 +890,6 @@ DROP TABLE g1; CREATE TABLE g1(a TEXT NOT NULL, KEY(a(255))); INSERT INTO g1 VALUES ('a'),('a'); -# --error ER_GIS_INVALID_DATA SELECT 1 FROM g1 WHERE a >= ANY (SELECT 1 FROM g1 WHERE a = ST_geomfromtext('') OR a) ; diff --git a/mysql-test/suite/innodb_gis/t/bug16236208.test b/mysql-test/suite/innodb_gis/t/bug16236208.test index b55ab1d0fd3..3a1fbefc52c 100644 --- a/mysql-test/suite/innodb_gis/t/bug16236208.test +++ b/mysql-test/suite/innodb_gis/t/bug16236208.test @@ -47,7 +47,6 @@ ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')); CREATE INDEX linestring_index ON linestring(linestring_nokey(5)); ALTER TABLE linestring ADD KEY (linestring_key(5)); -# --error ER_GIS_INVALID_DATA SELECT ST_AsText(linestring_nokey) FROM linestring FORCE KEY ( linestring_key ) WHERE ST_CONTAINS( ST_GeomFromText('POLYGON( ( 3923 2815 , 4246 2122 , 4028 2971 , 4017 3019 , 3923 2815 ) )') , linestring_key ) AND diff --git a/mysql-test/suite/innodb_gis/t/create_spatial_index.test b/mysql-test/suite/innodb_gis/t/create_spatial_index.test index 7ddece9ad86..ef87a51d372 100644 --- a/mysql-test/suite/innodb_gis/t/create_spatial_index.test +++ b/mysql-test/suite/innodb_gis/t/create_spatial_index.test @@ -1143,7 +1143,6 @@ insert into `t1` values( linestring(point(1,1),point(1,1)) ); -# --error ER_GIS_INVALID_DATA --error ER_BAD_NULL_ERROR insert into `t1` values ( diff --git a/mysql-test/suite/innodb_gis/t/gis.test b/mysql-test/suite/innodb_gis/t/gis.test index 44aec76770a..629bb94b8c5 100644 --- a/mysql-test/suite/innodb_gis/t/gis.test +++ b/mysql-test/suite/innodb_gis/t/gis.test @@ -1,4 +1,4 @@ -# This is a testcase copied from mysql-test/t/gis.test +# This is a testcase copied from mysql-test/main/gis.test --source include/have_innodb.inc -- source include/have_geometry.inc @@ -388,7 +388,6 @@ insert into t1 values (1.11); --error 1416 insert into t1 values ("qwerty"); --error 1048 -# --error ER_GIS_INVALID_DATA insert into t1 values (ST_pointfromtext('point(1,1)')); drop table t1; @@ -431,7 +430,6 @@ select ST_y(b) IS NULL from t1; -# --error ER_GIS_INVALID_DATA select MBRwithin(b, b) IS NULL, MBRcontains(b, b) IS NULL, MBRoverlaps(b, b) IS NULL, MBRequals(b, b) IS NULL, MBRdisjoint(b, b) IS NULL, ST_touches(b, b) IS NULL, @@ -460,7 +458,6 @@ DROP TABLE t1; # CREATE TABLE `t1` ( `col9` set('a'), `col89` date); INSERT IGNORE INTO `t1` VALUES ('','0000-00-00'); -# --error ER_GIS_INVALID_DATA select ST_geomfromtext(col9,col89) as a from t1; DROP TABLE t1; @@ -617,17 +614,11 @@ SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRwithin FROM t1 a1 JOIN # MBROverlaps needs a few more tests, with point and line dimensions -# --error ER_GIS_INVALID_DATA SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); -# --error ER_GIS_INVALID_DATA SET @horiz1 = ST_GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz2 = ST_GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz3 = ST_GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); -# --error ER_GIS_INVALID_DATA SET @point1 = ST_GeomFromText('POLYGON ((0 0))'); -# --error ER_GIS_INVALID_DATA SET @point2 = ST_GeomFromText('POLYGON ((-2 0))'); SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS MBRoverlaps FROM t1 a1 WHERE MBROverlaps(a1.square, @vert1) GROUP BY a1.name; @@ -767,10 +758,8 @@ SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUA --echo # BUG#51875: crash when loading data into geometry function ST_polyfromwkb --echo # SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; -# --error ER_GIS_INVALID_DATA SET @a=ST_POLYFROMWKB(@a); SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; -# --error ER_GIS_INVALID_DATA SET @a=ST_POLYFROMWKB(@a); @@ -903,7 +892,6 @@ DROP TABLE g1; CREATE TABLE g1(a TEXT NOT NULL, KEY(a(255))); INSERT INTO g1 VALUES ('a'),('a'); -# --error ER_GIS_INVALID_DATA SELECT 1 FROM g1 WHERE a >= ANY (SELECT 1 FROM g1 WHERE a = ST_geomfromtext('') OR a) ; @@ -1442,6 +1430,5 @@ DROP DATABASE gis_ogs; --echo # Bug#13362660 ASSERTION `FIELD_POS < FIELD_COUNT' FAILED. IN PROTOCOL_TEXT::STORE --echo # -# --error ER_GIS_INVALID_DATA --error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION SELECT ST_Union('', ''), md5(1); diff --git a/mysql-test/suite/innodb_gis/t/precise.test b/mysql-test/suite/innodb_gis/t/precise.test index 08b7e348362..3ddfc9369a4 100644 --- a/mysql-test/suite/innodb_gis/t/precise.test +++ b/mysql-test/suite/innodb_gis/t/precise.test @@ -122,7 +122,6 @@ SELECT ST_Equals(ST_PointFromText('POINT (12 13)'),ST_PointFromText('POINT (12 1 --echo # BUG#11759650/51979: UNION/INTERSECTION OF POLYGONS CRASHES MYSQL --echo # -# --error ER_GIS_INVALID_DATA SELECT ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('POLYGON((525000 183300,525400 183300,525400 18370, 525000 183700,525000 183300))'), ST_geomfromtext('POLYGON((525298.67 183511.53,525296.57 diff --git a/mysql-test/suite/innodb_gis/t/rtree.test b/mysql-test/suite/innodb_gis/t/rtree.test index 58d81576b3e..98931e70e62 100644 --- a/mysql-test/suite/innodb_gis/t/rtree.test +++ b/mysql-test/suite/innodb_gis/t/rtree.test @@ -78,17 +78,11 @@ SELECT name, ST_AsText(square) from t1 where MBRWithin(@p, square); # MBROverlaps needs a few more tests, with point and line dimensions -# --error ER_GIS_INVALID_DATA SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); -# --error ER_GIS_INVALID_DATA SET @horiz1 = ST_GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz2 = ST_GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz3 = ST_GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); -# --error ER_GIS_INVALID_DATA SET @point1 = ST_GeomFromText('POLYGON ((0 0))'); -# --error ER_GIS_INVALID_DATA SET @point2 = ST_GeomFromText('POLYGON ((-2 0))'); SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS MBRoverlaps FROM t1 a1 WHERE MBROverlaps(a1.square, @vert1) GROUP BY a1.name; diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index ac710a7ab85..40c07805315 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -140,6 +140,10 @@ select 2; 2 2 drop table t1; +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; set global server_audit_events='query_ddl,query_dml'; create table t1(id int); insert into t1 values (1), (2); @@ -211,6 +215,14 @@ select 2; 2 2 drop table t1; +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; set global server_audit_events='table'; set global server_audit_incl_users='user1'; create user user1@localhost; @@ -406,6 +418,10 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create procedure pr1() insert into test.t1 values ("foo", 42)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create function fn1(i int) returns int deterministic return i+1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop procedure pr1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop function fn1',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index 8edf898a998..01da49756d0 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -107,6 +107,12 @@ select 2; /*! select 2*/; /*comment*/ select 2; drop table t1; + +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; + set global server_audit_events='query_ddl,query_dml'; create table t1(id int); insert into t1 values (1), (2); @@ -146,6 +152,15 @@ insert into t1 values (1), (2); select * from t1; select 2; drop table t1; +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; + +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; set global server_audit_events='table'; set global server_audit_incl_users='user1'; |