[wp-trac] [WordPress Trac] #42362: WordPress database error Unknown column 'wp_mywordpresssite' in 'field list'

WordPress Trac noreply at wordpress.org
Tue Aug 2 16:33:16 UTC 2022


#42362: WordPress database error Unknown column 'wp_mywordpresssite' in 'field
list'
------------------------------------------------+--------------------------
 Reporter:  lazam786                            |       Owner:
                                                |  SergeyBiryukov
     Type:  defect (bug)                        |      Status:  closed
 Priority:  normal                              |   Milestone:  6.1
Component:  Database                            |     Version:  4.6
 Severity:  normal                              |  Resolution:  fixed
 Keywords:  php8 php81 has-patch needs-testing  |     Focuses:
------------------------------------------------+--------------------------
Changes (by SergeyBiryukov):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"53812" 53812]:
 {{{
 #!CommitTicketReference repository="" revision="53812"
 Database: Suppress errors when checking the validity of table prefix
 during installation.

 There are some table prefixes (for example, `7e1_`), which the database
 will try and parse as values unless they are quoted in backticks. Because
 not everyone remembers to quote their table names, WordPress discourages
 use of such prefixes during setup.

 To test if the table prefix is valid, WordPress executes a query
 deliberately trying to generate an error:
 > `Unknown column 'wp_' in 'field list'`
 which means the prefix is safe to use, as the database was not able to
 parse it as a value.

 Previously, this error would not be displayed to the user in a typical
 configuration, but would be logged on the server via
 `wpdb::print_error()`, and in some cases could block the installation.

 This commit makes sure the error is still checked to display a proper
 message in case the prefix needs to be edited, but otherwise is silently
 discarded instead of being logged.

 Follow-up to [37581], [41631], [51582].

 Props pento, lazam786, Velochicdunord, irecinius, mikemanzo, dd32,
 blackawxs, codewhy, psykro, burgiuk, mdrago, maythamalsudany,
 peterwilsoncc, sumitsingh, deksar, SergeyBiryukov.
 Fixes #42362.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42362#comment:44>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list