-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
607e5a0
MDEV-33616: Routines of a mixed case database are not listed
DaveGosselin-MariaDB 4a45813
MDEV-33616: Only one of two routines named in a statement is found
DaveGosselin-MariaDB 197f9b7
MDEV-33616: Detect select() on macOS
DaveGosselin-MariaDB a23720f
MDEV-33616: Make two tests independent of lower_case_table_names
DaveGosselin-MariaDB 3dd9b84
MDEV-33616: MTR flag to mark tests as incompatible with macOS
DaveGosselin-MariaDB 9c793c1
MDEV-33616: Exclude innodb_log_file_mmap from sys_vars.sysvars_innodb
DaveGosselin-MariaDB 08c2a9c
MDEV-33616: Widen the block count filter in the buffer pool resize test
DaveGosselin-MariaDB ac33f95
MDEV-33616: Normalize the strerror text in innodb_fts.index_table
DaveGosselin-MariaDB f5b5bf4
MDEV-33616: Match the macOS dlopen error in plugins.multiauth
DaveGosselin-MariaDB 9513b13
MDEV-33616: Allocate the recovery buffer from the heap
DaveGosselin-MariaDB aa3be40
MDEV-33616: Skip the redo log upgrade tests without sparse file support
DaveGosselin-MariaDB 58882b3
MDEV-33616: Take the read lock many times in perfschema.func_mutex
DaveGosselin-MariaDB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Skip the test unless the filesystem holding $sparse_file_dir stores files | ||
| # with holes. The caller sets $sparse_file_dir to a directory on the | ||
| # filesystem where it builds its own sparse file, because vardir and datadir | ||
| # can be on different filesystems. | ||
| # | ||
| # 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. | ||
|
|
||
| if (!$sparse_file_dir) | ||
| { | ||
| --die have_sparse_files.inc requires the caller to set sparse_file_dir | ||
| } | ||
| # The probe cannot tell a directory it may not write from a filesystem | ||
| # without holes, thus a missing directory ends the test rather than skipping | ||
| # it. | ||
| --file_exists $sparse_file_dir | ||
| # mysqltest keeps variables in a case insensitive hash and exports a value | ||
| # under whichever spelling created the entry, so the exported name has to | ||
| # differ from $sparse_file_dir by more than case. | ||
| --let SPARSE_PROBE_DIR= $sparse_file_dir | ||
|
|
||
| --error 0,1 | ||
| perl; | ||
| use strict; | ||
| use warnings; | ||
|
|
||
| my $probe= "$ENV{SPARSE_PROBE_DIR}/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 filesystem that stores files with holes | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --lower-case-table-names=2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.