[wp-trac] [WordPress Trac] #24800: DROP TABLE error 1051 (Unknown table)

WordPress Trac noreply at wordpress.org
Thu Jan 30 20:07:02 UTC 2014


#24800: DROP TABLE error 1051 (Unknown table)
--------------------------+------------------------------
 Reporter:  soulseekah    |       Owner:  nacin
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Unit Tests    |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by jdgrimes):

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


Comment:

 Replying to [comment:4 nacin]:
 > In [changeset:"27041"]:
 > {{{
 > #!CommitTicketReference repository="" revision="27041"
 > Test framework: Parse CREATE TABLE queries the same way we do DROP TABLE
 queries.
 >
 > props soulseekah.
 > fixes #24800.
 > }}}

 This has broken some things. I noticed that some unit tests for one of my
 plugins were giving strange results. In one unit test for multisite, a
 blog would be created using `$this->factory->blog->create()`. Then stuff
 would fly apart in the next unit test, because for some reason the changes
 were being committed instead of rolled-back by MySQL. I eventually traced
 this down to the fact that the `CREATE TABLE` queries for new a new blog
 will have a leading newline. That is causing the `CREATE TABLE` query not
 to be converted to a `CREATE TEMPORARY TABLE` query. It worked before,
 because it was a simple `str_replace()`. Now it will ignore the query if
 there is leading whitespace.

 I'll attach a patch with a possible fix.

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


More information about the wp-trac mailing list