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
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:enhancement Type: Enhancement. Contains minor improvements
Milestone

Comments

@nmalcolm
Copy link
Contributor

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

@DiogoParrinha DiogoParrinha added this to the 1.6.14 milestone Jun 7, 2014
@Stefan-MyBB Stefan-MyBB added 1.8 and removed 1.6 labels Jun 12, 2014
@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8 Beta 2, 1.6.14 Jun 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:enhancement Type: Enhancement. Contains minor improvements
Projects
None yet
Development

No branches or pull requests

3 participants