Skip to content
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

Bug: table alias is prefixed when LIKE clause #5360

Closed
kenjis opened this issue Nov 20, 2021 · 0 comments · Fixed by #5361
Closed

Bug: table alias is prefixed when LIKE clause #5360

kenjis opened this issue Nov 20, 2021 · 0 comments · Fixed by #5361
Assignees
Labels
bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer

Comments

@kenjis
Copy link
Member

kenjis commented Nov 20, 2021

PHP Version

7.3

CodeIgniter4 Version

4.1.5, develop (03f5195)

CodeIgniter4 Installation Method

Git

Which operating systems have you tested for this bug?

macOS

Which server did you use?

cli

Database

No response

What happened?

See https://forum.codeigniter.com/thread-80559.html

Steps to Reproduce

$builder = $this->db->table('jobs j');
$builder->like('j.name', 'veloper');
$actual = $builder->getCompiledSelect()
Expected :'SELECT * FROM "db_jobs" "j" WHERE "j"."name" LIKE '%veloper%' ESCAPE '!''
Actual   :'SELECT * FROM "db_jobs" "j" WHERE "db_""j"."name" LIKE '%veloper%' ESCAPE '!''

Expected Output

SELECT * FROM "db_jobs" "j" WHERE "j"."name" LIKE '%veloper%' ESCAPE '!'

Anything else?

No response

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Nov 20, 2021
@kenjis kenjis self-assigned this Nov 20, 2021
kenjis added a commit to kenjis/CodeIgniter4 that referenced this issue Nov 20, 2021
kenjis added a commit to kenjis/CodeIgniter4 that referenced this issue Nov 20, 2021
@kenjis kenjis added the database Issues or pull requests that affect the database layer label Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant