https://bugzilla.wikimedia.org/show_bug.cgi?id=50114

       Web browser: ---
            Bug ID: 50114
           Summary: MySQL database updates do not enclose field names in
                    back ticks(`) causing fields to be dropped with
                    reserved words.
           Product: MediaWiki
           Version: 1.21.1
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: Database
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

If the group MySQL key word or other reserved key words are in the values array
to update a row it either is silently ignored by MySQL or causes a database
error.  This is due to the makeList() function not enclosing field names in
back ticks(`).

$this->DB->update(
    'example_table',
    array('group' => 1),
    array('example_id' => 100),
    __METHOD__
);

Generated SQL: "UPDATE example_table SET group = 1 WHERE example_id = 100;"

Solution: Field names need to be enclosed in back ticks.

Suggested code change: Use the provided addIdentifierQuotes() function on field
names in the makeList() function.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to