summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2014-05-05 23:14:24 -0400
committerDavid Rothstein <drothstein@gmail.com>2014-05-05 23:14:24 -0400
commit20c04c587beb78094cdc1302f9c226af8931747c (patch)
tree7f5e9cd596b21fe2b42f4edf0cd607085416f32a /modules/simpletest
parent57bd9625f312ad4edea6b9fc45589b5be3a7933b (diff)
downloadbrdo-20c04c587beb78094cdc1302f9c226af8931747c.tar.gz
brdo-20c04c587beb78094cdc1302f9c226af8931747c.tar.bz2
Issue #1868972 by jweowu, DanChadwick: Db_query_temporary() fails to create a table when the SQL has leading whitespace.
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/database_test.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index c3f52551e..dba04b27b 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -3137,6 +3137,15 @@ class DatabaseTemporaryQueryTestCase extends DrupalWebTestCase {
$this->assertEqual($this->countTableRows($table_name_system), $this->countTableRows("system"), 'A temporary table was created successfully in this request.');
$this->assertEqual($this->countTableRows($table_name_users), $this->countTableRows("users"), 'A second temporary table was created successfully in this request.');
+
+ // Check that leading whitespace and comments do not cause problems
+ // in the modified query.
+ $sql = "
+ -- Let's select some rows into a temporary table
+ SELECT name FROM {test}
+ ";
+ $table_name_test = db_query_temporary($sql, array());
+ $this->assertEqual($this->countTableRows($table_name_test), $this->countTableRows('test'), 'Leading white space and comments do not interfere with temporary table creation.');
}
}