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

Using update_query with BIT(1) fields. #360

Closed
nmalcolm opened this issue Mar 3, 2014 · 0 comments
Closed

Using update_query with BIT(1) fields. #360

nmalcolm opened this issue Mar 3, 2014 · 0 comments

Comments

@nmalcolm
Copy link
Contributor

@nmalcolm nmalcolm commented Mar 3, 2014

Due to the way update_query (and, likely, insert_query) works, the following will always result in the field being 1 when the field is defined as datatype "Bit(1)":

$db->update_query( 'alert_settings', array( 'enabled' => 0, ), "id='{$id}'", 1 )

This is the database schema:

id int(10) code varchar(75) enabled bit(1)

This is, I believe, caused by the database class quoting the input even when it is numeric. A simple solution would be to check if input is an integer in the database method and not quote it if so.

Original report: http://dev.mybb.com/issues/2273
Reporter: Euan Torano
Status: New

@nmalcolm nmalcolm added bug labels Mar 3, 2014
@DiogoParrinha DiogoParrinha added this to the 1.6.14 milestone Jun 7, 2014
@Stefan-ST Stefan-ST added 1.8 and removed 1.6 labels Jun 12, 2014
@Stefan-ST Stefan-ST modified the milestones: 1.8 Beta 2, 1.6.14 Jun 12, 2014
@Stefan-ST Stefan-ST closed this Jun 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.