revert last commit -- this is a bad way to do it, and I'll have to come up with something else
to let people use strings like %i in their SQL and bypass the parser
This commit is contained in:
@@ -270,13 +270,10 @@ class DB
|
||||
while (($pos = strpos($sql, $type, $lastPos)) !== false) {
|
||||
$lastPos = $pos + 1;
|
||||
if (isset($posList[$pos]) && strlen($posList[$pos]) > strlen($type)) continue;
|
||||
if (substr($sql, $pos - 1, 1) == '%') continue;
|
||||
$posList[$pos] = $type;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = str_replace('%%', '%', $sql);
|
||||
|
||||
ksort($posList);
|
||||
|
||||
foreach ($posList as $pos => $type) {
|
||||
|
||||
@@ -23,11 +23,6 @@ class BasicTest extends SimpleTest {
|
||||
DB::useDB('libdb_test');
|
||||
}
|
||||
|
||||
function test_0_5_date_format() {
|
||||
$month = DB::queryFirstField("SELECT DATE_FORMAT(NOW(), '%%b')", 4);
|
||||
$this->assert($month === date('M'));
|
||||
}
|
||||
|
||||
|
||||
function test_1_create_table() {
|
||||
DB::query("CREATE TABLE `accounts` (
|
||||
|
||||
Reference in New Issue
Block a user