New test-query that does not violate any foreign key contraints

release-0.6
thomascube 17 years ago
parent edc63c2e38
commit 50e5eef2e3

@ -120,12 +120,12 @@ if ($db_working) {
// more database tests // more database tests
if ($db_working) { if ($db_working) {
// write test // write test
$db_write = $DB->query("INSERT INTO {$RCI->config['db_table_cache']} (session_id, cache_key, data, user_id) VALUES (?, ?, ?, 0)", '1234567890abcdef', 'test', 'test'); $insert_id = md5(uniqid());
$insert_id = $DB->insert_id($RCI->config['db_sequence_cache']); $db_write = $DB->query("INSERT INTO {$RCI->config['db_table_session']} (sess_id, created, ip, vars) VALUES (?, ".$DB->now().", '127.0.0.1', 'foo')", $insert_id);
if ($db_write && $insert_id) { if ($db_write) {
$RCI->pass('DB Write'); $RCI->pass('DB Write');
$DB->query("DELETE FROM {$RCI->config['db_table_cache']} WHERE cache_id=?", $insert_id); $DB->query("DELETE FROM {$RCI->config['db_table_session']} WHERE sess_id=?", $insert_id);
} }
else { else {
$RCI->fail('DB Write', $RCI->get_error()); $RCI->fail('DB Write', $RCI->get_error());

Loading…
Cancel
Save