Skip to content
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

Tests: MDEV-29446 workaround: Ignore COLLATE clause in SHOW CREATE TABLE #4913

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

Deltik
Copy link
Member

@Deltik Deltik commented Dec 1, 2022

Motivation and Context

Failing test:

---------
1) db_table_adminTest: Get_current_table
 Test  tests/unit/db_table_adminTest.php:testGet_current_table
Failed asserting that two arrays are identical.
- Expected | + Actual
@@ @@
e107_name varchar(100) NOT NULL DEFAULT '',\n
e107_value text NOT NULL,\n
PRIMARY KEY (e107_name)\n
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;'
1 => 'e107_core'
2 => 'e107_name varchar(100) NOT NULL DEFAULT '',\n
e107_value text NOT NULL,\n
PRIMARY KEY (e107_name)'
-        3 => 'MyISAM DEFAULT CHARSET=utf8'
+        3 => 'MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci'
)
)
#1  /__w/e107/e107/e107_tests/tests/unit/db_table_adminTest.php:355
#2  /__w/e107/e107/e107_tests/vendor/bin/codecept:120

Description

https://jira.mariadb.org/browse/MDEV-29446 changes the output of SHOW CREATE TABLE, which MySQL and MariaDB 10.2 and older do not do.

To tolerate the new behavior, this change strips the COLLATE clause from the SHOW CREATE TABLE output to ignore it.

Fixes: #4912

How Has This Been Tested?

Test modified

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist

https://jira.mariadb.org/browse/MDEV-29446 changes the output of
`SHOW CREATE TABLE`, which MySQL and MariaDB 10.2 and older do not do.

To tolerate the new behavior, this change strips the `COLLATE` clause
from the `SHOW CREATE TABLE` output to ignore it.

Fixes: e107inc#4912
@Deltik Deltik requested a review from CaMer0n December 1, 2022 00:00
@codeclimate
Copy link

codeclimate bot commented Dec 1, 2022

Code Climate has analyzed commit ae3c57a and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 34.3% (-0.3% change).

View more on Code Climate.

@CaMer0n CaMer0n merged commit a367b34 into e107inc:master Dec 1, 2022
@Deltik Deltik deleted the fix/4912 branch December 1, 2022 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failing on MariaDB 10.3+: db_table_adminTest()
2 participants