-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Collection of fixes for macOS #5654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 11.4
Are you sure you want to change the base?
Changes from all commits
4ff2efb
946892b
7de1c57
74fb9cb
fa942f5
c33abfb
4e82067
513ad07
954e784
950f10c
343dc55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Skip the test unless the vardir filesystem stores files with holes. | ||
| # | ||
| # A test that builds a large file by seeking past its end and writing a | ||
| # single byte relies on the skipped range staying unallocated. HFS on | ||
| # macOS allocates every block of that range, so the file consumes its full | ||
| # apparent size and the write fails with ENOSPC once the range exceeds the | ||
| # free space on the volume. | ||
| # | ||
| # The probe writes one byte 64MB past the start of an empty file and compares | ||
| # the allocated block count against that offset. A filesystem that leaves a | ||
| # hole allocates only the block holding the byte. The offset has to stay well | ||
| # above 16MB, since APFS fills the range of a file smaller than that rather | ||
| # than recording a hole. | ||
|
|
||
| --error 0,1 | ||
| perl; | ||
| use strict; | ||
| use warnings; | ||
|
|
||
| my $probe= "$ENV{MYSQLTEST_VARDIR}/tmp/sparse_probe"; | ||
| my $offset= 64 * 1024 * 1024; | ||
| my $sparse= 0; | ||
|
|
||
| if (open(my $fh, '>', $probe)) | ||
| { | ||
| binmode $fh; | ||
| if (seek($fh, $offset, 0) and print($fh chr(0)) and close($fh)) | ||
| { | ||
| my $blocks= (stat $probe)[12]; | ||
| $sparse= 1 if defined($blocks) and $blocks * 512 < $offset; | ||
| } | ||
| } | ||
| unlink $probe; | ||
| exit($sparse ? 0 : 1); | ||
| EOF | ||
| if ($errno) | ||
| { | ||
| --skip Requires a vardir filesystem that stores files with holes | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # | ||
| # suite.pm will make sure that all tests including this file | ||
| # will be skipped if run under macOS | ||
| # |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --lower-case-table-names=2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # | ||
| # MDEV-33616 Routines of a mixed case database are not listed when | ||
| # lower_case_table_names is 2 | ||
| # | ||
| CREATE DATABASE Db1; | ||
| USE Db1; | ||
| CREATE FUNCTION f1(a INT) RETURNS INT RETURN a; | ||
| CREATE PROCEDURE p1(b INT) BEGIN END; | ||
| SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME='Db1'; | ||
| SCHEMA_NAME | ||
| Db1 | ||
| SELECT db, name FROM mysql.proc WHERE name IN ('f1','p1'); | ||
| db name | ||
| db1 f1 | ||
| db1 p1 | ||
| SELECT ROUTINE_NAME FROM information_schema.ROUTINES | ||
| WHERE ROUTINE_SCHEMA='Db1'; | ||
| ROUTINE_NAME | ||
| f1 | ||
| p1 | ||
| SELECT SPECIFIC_NAME, ORDINAL_POSITION, PARAMETER_NAME | ||
| FROM information_schema.PARAMETERS WHERE SPECIFIC_SCHEMA='Db1'; | ||
| SPECIFIC_NAME ORDINAL_POSITION PARAMETER_NAME | ||
| f1 0 NULL | ||
| f1 1 a | ||
| p1 1 b | ||
| SHOW FUNCTION STATUS WHERE Db='Db1'; | ||
| Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation | ||
| db1 f1 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci | ||
| SHOW PROCEDURE STATUS WHERE Db='Db1'; | ||
| Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation | ||
| db1 p1 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci | ||
| SELECT ROUTINE_NAME FROM information_schema.ROUTINES | ||
| WHERE ROUTINE_SCHEMA='Db1' ORDER BY ROUTINE_NAME; | ||
| ROUTINE_NAME | ||
| f1 | ||
| p1 | ||
| SELECT SPECIFIC_NAME, ORDINAL_POSITION, PARAMETER_NAME | ||
| FROM information_schema.PARAMETERS WHERE SPECIFIC_SCHEMA='Db1' | ||
| ORDER BY SPECIFIC_NAME, ORDINAL_POSITION; | ||
| SPECIFIC_NAME ORDINAL_POSITION PARAMETER_NAME | ||
| f1 0 NULL | ||
| f1 1 a | ||
| p1 1 b | ||
| USE test; | ||
| DROP DATABASE Db1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # | ||
| # Tests that require lower_case_table_names to be 2 | ||
| # (the default when the data directory is on a case insensitive file system) | ||
| # | ||
| --source include/have_lowercase2.inc | ||
|
|
||
| --echo # | ||
| --echo # MDEV-33616 Routines of a mixed case database are not listed when | ||
| --echo # lower_case_table_names is 2 | ||
| --echo # | ||
|
|
||
| CREATE DATABASE Db1; | ||
| USE Db1; | ||
| CREATE FUNCTION f1(a INT) RETURNS INT RETURN a; | ||
| CREATE PROCEDURE p1(b INT) BEGIN END; | ||
|
|
||
| # The database keeps the case it was created with, mysql.proc does not. | ||
| SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME='Db1'; | ||
| --sorted_result | ||
| SELECT db, name FROM mysql.proc WHERE name IN ('f1','p1'); | ||
|
|
||
| # The name from the WHERE clause becomes the key of an index read on | ||
| # mysql.proc. mysql.proc.db is utf8mb3_bin and holds the folded name, so | ||
| # an unfolded key finds nothing. | ||
| --sorted_result | ||
| SELECT ROUTINE_NAME FROM information_schema.ROUTINES | ||
| WHERE ROUTINE_SCHEMA='Db1'; | ||
| --sorted_result | ||
| SELECT SPECIFIC_NAME, ORDINAL_POSITION, PARAMETER_NAME | ||
| FROM information_schema.PARAMETERS WHERE SPECIFIC_SCHEMA='Db1'; | ||
| --replace_column 5 # 6 # | ||
| SHOW FUNCTION STATUS WHERE Db='Db1'; | ||
| --replace_column 5 # 6 # | ||
| SHOW PROCEDURE STATUS WHERE Db='Db1'; | ||
|
|
||
| # ORDER BY keeps the condition from reaching the routine that fills the | ||
| # table, so mysql.proc is read in full and the WHERE is applied afterwards | ||
| # over a utf8mb3_general_ci column. That shape returned the rows even | ||
| # while the queries above returned none. | ||
| SELECT ROUTINE_NAME FROM information_schema.ROUTINES | ||
| WHERE ROUTINE_SCHEMA='Db1' ORDER BY ROUTINE_NAME; | ||
| SELECT SPECIFIC_NAME, ORDINAL_POSITION, PARAMETER_NAME | ||
| FROM information_schema.PARAMETERS WHERE SPECIFIC_SCHEMA='Db1' | ||
| ORDER BY SPECIFIC_NAME, ORDINAL_POSITION; | ||
|
|
||
| USE test; | ||
| DROP DATABASE Db1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # | ||
| # MDEV-33616 A statement cannot reference two routines whose databases | ||
| # differ only in case | ||
| # | ||
| CREATE DATABASE Db1; | ||
| CREATE DATABASE db1; | ||
| CREATE FUNCTION Db1.f1() RETURNS INT RETURN 1; | ||
| CREATE FUNCTION db1.f1() RETURNS INT RETURN 2; | ||
| CREATE PROCEDURE test.p1() SELECT Db1.f1(), db1.f1(); | ||
| SELECT Db1.f1(); | ||
| Db1.f1() | ||
| 1 | ||
| SELECT db1.f1(); | ||
| db1.f1() | ||
| 2 | ||
| connect con1,localhost,root,,test; | ||
| SELECT Db1.f1(), db1.f1(); | ||
| Db1.f1() db1.f1() | ||
| 1 2 | ||
| disconnect con1; | ||
| connect con2,localhost,root,,test; | ||
| SELECT db1.f1(), Db1.f1(); | ||
| db1.f1() Db1.f1() | ||
| 2 1 | ||
| disconnect con2; | ||
| connect con3,localhost,root,,test; | ||
| CALL test.p1(); | ||
| Db1.f1() db1.f1() | ||
| 1 2 | ||
| disconnect con3; | ||
| connect con4,localhost,root,,test; | ||
| SELECT db1.f1(); | ||
| db1.f1() | ||
| 2 | ||
| connection default; | ||
| DROP FUNCTION db1.f1; | ||
| CREATE FUNCTION db1.f1() RETURNS INT RETURN 99; | ||
| connection con4; | ||
| SELECT Db1.f1(), db1.f1(); | ||
| Db1.f1() db1.f1() | ||
| 1 99 | ||
| disconnect con4; | ||
| connection default; | ||
| DROP PROCEDURE test.p1; | ||
| DROP DATABASE Db1; | ||
| DROP DATABASE db1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # | ||
| # Tests that require lower_case_table_names to be 0 | ||
| # (the default when the data directory is on a case sensitive file system) | ||
| # | ||
| --source include/have_lowercase0.inc | ||
| --source include/have_case_sensitive_file_system.inc | ||
|
|
||
| --echo # | ||
| --echo # MDEV-33616 A statement cannot reference two routines whose databases | ||
| --echo # differ only in case | ||
| --echo # | ||
|
|
||
| CREATE DATABASE Db1; | ||
| CREATE DATABASE db1; | ||
| CREATE FUNCTION Db1.f1() RETURNS INT RETURN 1; | ||
| CREATE FUNCTION db1.f1() RETURNS INT RETURN 2; | ||
| CREATE PROCEDURE test.p1() SELECT Db1.f1(), db1.f1(); | ||
|
|
||
| SELECT Db1.f1(); | ||
| SELECT db1.f1(); | ||
|
|
||
| # Every routine a statement names joins one set, keyed by the database and | ||
| # the routine name. The database name is case sensitive here, so the two | ||
| # routines have to stay apart and each reference has to reach its own. A | ||
| # connection that already holds one of them in its routine cache resolves | ||
| # both either way, so every check below starts from a connection that holds | ||
| # neither. | ||
| connect (con1,localhost,root,,test); | ||
| # A view compares its column names without regard to case, so under the | ||
| # view protocol the second column of a query like this one is given a | ||
| # generated name. | ||
| --disable_view_protocol | ||
| SELECT Db1.f1(), db1.f1(); | ||
| --enable_view_protocol | ||
| disconnect con1; | ||
|
|
||
| connect (con2,localhost,root,,test); | ||
| --disable_view_protocol | ||
| SELECT db1.f1(), Db1.f1(); | ||
| --enable_view_protocol | ||
| disconnect con2; | ||
|
|
||
| # A statement inside a routine body builds the same set. | ||
| connect (con3,localhost,root,,test); | ||
| CALL test.p1(); | ||
| disconnect con3; | ||
|
|
||
| # A routine missing from the set is neither locked nor checked against the | ||
| # version of the routine cache, so it could execute a definition that | ||
| # another connection had already replaced. | ||
| connect (con4,localhost,root,,test); | ||
| SELECT db1.f1(); | ||
| connection default; | ||
| DROP FUNCTION db1.f1; | ||
| CREATE FUNCTION db1.f1() RETURNS INT RETURN 99; | ||
| connection con4; | ||
| --disable_view_protocol | ||
| SELECT Db1.f1(), db1.f1(); | ||
| --enable_view_protocol | ||
| disconnect con4; | ||
| connection default; | ||
|
|
||
| DROP PROCEDURE test.p1; | ||
| DROP DATABASE Db1; | ||
| DROP DATABASE db1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,8 +58,10 @@ while ($e < $engine_count) | |
| while ($t < $max_tables) | ||
| { | ||
| inc $t; | ||
| let $name=`select concat("t",char(floor(65+$t/26)),repeat(char(65+mod($t,26)),60))`; | ||
| let $view=`select concat("t",char(floor(65+$t/26)),repeat(char(65+mod($t,26)),30),'v')`; | ||
| # Generate the names in lower case so that they are unchanged by a | ||
| # lower_case_table_names setting of 1 or 2. | ||
| let $name=`select concat("t",char(floor(97+$t/26)),repeat(char(97+mod($t,26)),60))`; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd do ASCII('a') instead of 97. |
||
| let $view=`select concat("t",char(floor(97+$t/26)),repeat(char(97+mod($t,26)),30),'v')`; | ||
| --eval create table $name (a int not null) $extra_option | ||
| --eval create view $view as select * from $name | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ send SET GLOBAL innodb_buffer_pool_size=8388608; | |
| connection default; | ||
| SET DEBUG_SYNC='now WAIT_FOR blocked'; | ||
| # adjust for 32-bit and SUX_LOCK_GENERIC | ||
| --replace_regex /(5..)\/\1/505\/505/ | ||
| --replace_regex /([45]..)\/\1/505\/505/ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needs a review from the innodb folks
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are the exact numbers here? MDEV-26476 was never fixed on macOS, even though there apparently is a solution nowadays. |
||
| SHOW STATUS LIKE 'innodb_buffer_pool_resize_status'; | ||
| SET DEBUG_SYNC='now SIGNAL go'; | ||
| connection con1; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # MDEV-32503 Queries from KEY_PERIOD_USAGE don't obey case-sensitivity | ||
| create table t (a int, b date, c date, period for app(b,c), | ||
| unique idx(a, app without overlaps)); | ||
| set names latin1 collate latin1_general_cs; | ||
| select table_name from information_schema.periods where table_schema = 'TEST'; | ||
| table_name | ||
| select table_name from information_schema.key_period_usage where table_schema = 'TEST'; | ||
| table_name | ||
| set names latin1 collate latin1_general_ci; | ||
| select table_name from information_schema.periods where table_schema = 'TEST'; | ||
| table_name | ||
| select table_name from information_schema.key_period_usage where table_schema = 'TEST'; | ||
| table_name | ||
| drop table t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use the data dir here. tmp could be a different filesystem (ramdisk). Or I'd make the .inc file take a parameter.