Skip to content

Conversation

@hevengo
Copy link

@hevengo hevengo commented Mar 5, 2024

  • removed blob/text default value checks
  • implemented unquote of default values on TEXT/BLOB fields
  • tested with mariadb 11.2.3

@smhg
Copy link
Contributor

smhg commented May 23, 2025

@hevengo can you please rebase your PR and force push the result?
I know it's been a while, but hopefully we can get this merged.

Copy link
Contributor

@smhg smhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely needs tests which CI can run on both MariaDB and MySQL:

  • a simple test case to prove setting a default on BLOB or TEXT works
  • a case where the default value itself is wrapped in single quotes

if ($default !== null) {
if (preg_match('~blob|text~', $nativeType)) {
// mariadb has extra single quotes on TEXT type default values, but not on other types
$default = preg_replace('@^\'(.*)\'$@', '$1', $row['Default']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use $default instead of $row['Default'] on this line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please use the more common regex delimiter / instead of @.


// BLOBs can't have any default values in MySQL
$default = preg_match('~blob|text~', $nativeType) ? null : $row['Default'];

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the empty line here.

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.28%. Comparing base (1ca6543) to head (b2638db).
⚠️ Report is 56 commits behind head on master.

Files with missing lines Patch % Lines
src/Propel/Generator/Reverse/MysqlSchemaParser.php 75.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1993      +/-   ##
============================================
- Coverage     89.28%   89.28%   -0.01%     
+ Complexity     8058     8056       -2     
============================================
  Files           232      232              
  Lines         24534    24534              
============================================
- Hits          21905    21904       -1     
- Misses         2629     2630       +1     
Flag Coverage Δ
5-max 89.28% <75.00%> (-0.01%) ⬇️
7.4 89.28% <75.00%> (-0.01%) ⬇️
agnostic 67.44% <0.00%> (-0.01%) ⬇️
mysql 69.82% <75.00%> (-0.01%) ⬇️
pgsql 69.87% <0.00%> (ø)
sqlite 67.81% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants