Skip to content

fix compiler that is concatenating string with an array on orderBy #6

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MPesic381
Copy link

This is a fix that is solving the issue #5

@MPesic381 MPesic381 changed the title fix compiler that is concatenating string with an array fix compiler that is concatenating string with an array on orderBy Jun 19, 2023
@adambanaszkiewicz
Copy link
Owner

Thanks for forking. Could You please provide me how repsoduce the bug? I cannot find out how this code fails.

@MPesic381
Copy link
Author

Thanks for forking. Could You please provide me how repsoduce the bug? I cannot find out how this code fails.

Assuming that source is QB Factory, when I try this

$data = source()->from('users')->orderBy('username')->all();

it throws me and error.

Next Requtize\QueryBuilder\Exception\QueryExecutionFailException: 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 '`username` ASC' at line 1 during query "SELECT * FROM `users` ORDER BY Array`username` ASC" in /home/unicode/vendor/requtize/query-builder/src/QueryBuilder/QueryBuilder/QueryBuilder.php:815
Stack trace:

Pay attention on the query that the package has build.

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.

2 participants