You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use a reserved word (range) for a table name and in previous versions of Laravel this was never an issue when using /Illuminate/Foundation/Testing/DatabaseTruncation::truncateTablesForConnection() as the table names were escaped before their existence check and truncation.
implements a new Expression containing the unescaped database and table names any tests that refresh our range table now blow up with:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range) as `exists`' at line 1 (Connection: mysql-elevated, SQL: select exists(select * from range) as `exists`)
Steps To Reproduce
Have a database table with a reserved word for a name and the same thing will happen.
The text was updated successfully, but these errors were encountered:
MizouziE
added a commit
to MizouziE/framework
that referenced
this issue
Dec 11, 2024
Thanks @hafezdivandari ! Glad I wasn't too far off the mark with a fix. I'm sure it didn't inconvenience many people as we're a bit of an edge case with singular named tables, but it was interesting to read up about reserved words etc.
Laravel Version
11.35.0
PHP Version
8.3.6
Database Driver & Version
8.0.40-0ubuntu0.22.04.1 (GitHub Actions)
Description
We use a reserved word (range) for a table name and in previous versions of Laravel this was never an issue when using
/Illuminate/Foundation/Testing/DatabaseTruncation::truncateTablesForConnection()
as the table names were escaped before their existence check and truncation.Since #53787 was merged and
framework/src/Illuminate/Foundation/Testing/DatabaseTruncation.php
Line 103 in 0755902
new Expression
containing the unescaped database and table names any tests that refresh ourrange
table now blow up with:Steps To Reproduce
Have a database table with a reserved word for a name and the same thing will happen.
The text was updated successfully, but these errors were encountered: