Skip to content

Bug: A wrong escape on BaseBuilder::set() #3127

Description

@smartse0k

Describe the bug
I guess it is a bug that the function named BaseBuilder::set() building wrong escape character

CodeIgniter 4 version
4.0.3 on master branch.

Affected module(s)
i don't know

Expected behavior, and steps to reproduce if appropriate
I expected follow compiled SQL with code:

  • source code in my model
    $this->where('ID', $id)->set('VIEW_COUNT', 'VIEW_COUNT + 1', false)->update();

  • expected SQL
    UPDATE TABLENAME SET VIEW_COUNT = VIEW_COUNT + 1, UPDATE_FIELD = 'date' WHERE ID = '1'

  • but, complied SQL (also the escape character in updatedField has been removed.)
    UPDATE TABLENAME SET VIEW_COUNT = VIEW_COUNT + 1, UPDATE_FIELD = date WHERE ID = '1'

Context

  • OS: CentOS 7
  • Apache Daemon (httpd) 2.4
  • PHP 7.4.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions