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
The model uses the hasOne method. If the link parameter is an array with two keys and the key is bigint, an error will occur. The reason is that the generated SQL will convert bigint into a string in PHP 7.4. The SQL is as follows:
#sql1SELECT*From TABLE WHERE (` id1 `, ` id2 `) IN ('bigint ',' bigint ')
At this time, mysql8 cannot find data. At the end of the filterByModels method in the file db/ActiveRelationTrait.php, the andWhere method is called, as follows:
$this ->and Where (['in ', $attributes, $values]);
If the SQL generated by the andWhere method is of the following type, then there is no problem.
#sql2SELECT*FROM TABLE WHERE (`id1`IN ('bigint1') AND`id2`IN (''bigint2')
If using php8, querying bigint will return an integer, and using sql1 is not a problem,
If using PHP 8 or below, it is also possible to configure data connections when connecting to the database as follows:
The model uses the hasOne method. If the link parameter is an array with two keys and the key is bigint, an error will occur. The reason is that the generated SQL will convert bigint into a string in PHP 7.4. The SQL is as follows:
At this time, mysql8 cannot find data. At the end of the filterByModels method in the file db/ActiveRelationTrait.php, the andWhere method is called, as follows:
$this ->and Where (['in ', $attributes, $values]);
If the SQL generated by the andWhere method is of the following type, then there is no problem.
If using php8, querying bigint will return an integer, and using sql1 is not a problem,
If using PHP 8 or below, it is also possible to configure data connections when connecting to the database as follows:
But the bigint returned by JSON data will exceed the maximum number of JS, so I suggest that andWhere generate sql2. Is this suggestion feasible
Additional info
The text was updated successfully, but these errors were encountered: