Skip to content

fix: resolve MySQL TEXT mapping, MSSQL varbinary insert, and select alias TypeError#175

Merged
usernane merged 4 commits into
devfrom
fix/bugs
Jun 17, 2026
Merged

fix: resolve MySQL TEXT mapping, MSSQL varbinary insert, and select alias TypeError#175
usernane merged 4 commits into
devfrom
fix/bugs

Conversation

@usernane

Copy link
Copy Markdown
Member

Summary

Fix three open bugs: TEXT→TINYTEXT mapping, MSSQL varbinary insert failure, and select() TypeError with string aliases. Close two already-fixed BIT(1) issues.

Motivation

Users reported data truncation, insert failures, and TypeErrors when using the query builder. Fixes #171, #170, #173. Refs #172, #174 (already fixed).

Changes

  • MySQLColumn::firstColPart(): TEXT type no longer includes a size parameter in DDL (was generating text(1) → TINYTEXT)
  • MSSQLInsertBuilder::parseValues(): binary/varbinary values wrapped with proper SQLSRV type metadata
  • SelectExpression::select(): string alias values wrapped in ["alias" => value] before passing to addColumn()
  • Added integration tests for all three fixes

How to Test / Verify

All fixes have unit/integration tests. Run:

php vendor/bin/phpunit -c tests/phpunit.xml --no-coverage

Requires MySQL and MSSQL test containers.

Breaking Changes and Migration Steps

None

Checklist

  • I reviewed my own diff before requesting review
  • My commits follow Conventional Commits
  • The title of the pull request follows Conventional Commits
  • I added/updated tests (or explained why not)
  • I updated docs (if needed)
  • I ran lint/cs-fixer (if applicable)
  • I considered backward compatibility
  • I considered security

Related issues

Closes #171, Closes #170, Closes #173
Refs #172, #174 (already fixed by commit 480e659)

Ibrahim BinAlshikh added 4 commits June 17, 2026 09:06
TEXT columns no longer include a size parameter in DDL output.
Previously text(1) was generated which MySQL interprets as TINYTEXT.

Closes #171
Values for binary/varbinary columns are now wrapped with
SQLSRV_PARAM_IN and SQLSRV_ENC_BINARY metadata so sqlsrv_prepare
does not attempt nvarchar conversion.

Closes #170
Verifies that boolean values can be inserted into BIT(1) columns
via the query builder, including explicit true/false and default values.

Refs #172
When an alias is passed as a string value in the select array
(e.g., ['col' => 'alias']), wrap it in ['alias' => value] before
passing to addColumn() which expects ?array.

Closes #173
@usernane usernane merged commit 055b00b into dev Jun 17, 2026
2 checks passed
@usernane usernane deleted the fix/bugs branch June 17, 2026 06:42
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.83%. Comparing base (a156977) to head (8e0b14c).
⚠️ Report is 5 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #175      +/-   ##
============================================
- Coverage     88.99%   88.83%   -0.17%     
- Complexity     2301     2304       +3     
============================================
  Files            59       59              
  Lines          5770     5776       +6     
============================================
- Hits           5135     5131       -4     
- Misses          635      645      +10     
Flag Coverage Δ
php-8.1 ?
php-8.2 ?
php-8.3 ?
php-8.4 88.83% <100.00%> (+0.02%) ⬆️
php-8.5 88.83% <100.00%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant