/** * @param $sql */ function opendb_pre_query($sql) { $dbserver_conf_r = get_opendb_config_var('db_server'); if (strlen($dbserver_conf_r['table_prefix']) > 0) { $sql = parse_sql_statement($sql, $dbserver_conf_r['table_prefix']); } if ($dbserver_conf_r['debug-sql'] === TRUE) { echo '<p class="debug-sql">SQL: ' . $sql . '</p>'; } return $sql; }
function testAddTableIndex2() { $this->assertEquals("ALTER TABLE opendb_item_attribute ADD INDEX attribute_val_idx ( attribute_val ( 255 ) )", parse_sql_statement("ALTER TABLE item_attribute ADD INDEX attribute_val_idx ( attribute_val ( 255 ) )", 'opendb_')); }