Rev 1130 | Rev 1155 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1130 | Rev 1150 | ||
---|---|---|---|
Line 318... | Line 318... | ||
318 | echo "Transaction commit: " . ($val == 'B' ? greentext('PASSED') : redtext('FAILED'))."\n"; |
318 | echo "Transaction commit: " . ($val == 'B' ? greentext('PASSED') : redtext('FAILED'))."\n"; |
319 | } else { |
319 | } else { |
320 | echo "Transaction support: " . redtext('Not supported') ."\n"; |
320 | echo "Transaction support: " . redtext('Not supported') ."\n"; |
321 | } |
321 | } |
322 | 322 | ||
323 | // --- Check natOrder feature |
- | |
324 | - | ||
325 | $db->query("delete from ###objects where parent = 'test:1'"); |
- | |
326 | $db->query("insert into ###objects (id, parent, title, description, confidential) values ('oid:3.1.10', 'test:1', '', '', '0')"); |
- | |
327 | $db->query("insert into ###objects (id, parent, title, description, confidential) values ('oid:3.1.2', 'test:1', '', '', '0')"); |
- | |
328 | $res = $db->query("select id from ###objects where parent = ? order by ".$db->natOrder('id'), array('test:1')); |
- | |
329 | //$res->num_rows(); // sponge |
- | |
330 | $val = $res->fetch_object()->id; |
- | |
331 | echo "Natural OID Sorting (< 16 Bit): " . ($val == 'oid:3.1.2' ? greentext('PASSED') : redtext('FAILED'))."\n"; |
- | |
332 | - | ||
333 | $db->query("delete from ###objects where parent = 'test:1'"); |
- | |
334 | $db->query("insert into ###objects (id, parent, title, description, confidential) values ('oid:2.25.317919736312109525688528068157180855579', 'test:1', '', '', '0')"); |
- | |
335 | $db->query("insert into ###objects (id, parent, title, description, confidential) values ('oid:2.25.67919736312109525688528068157180855579', 'test:1', '', '', '0')"); |
- | |
336 | $res = $db->query("select id from ###objects where parent = ? order by ".$db->natOrder('id'), array('test:1')); |
- | |
337 | //$res->num_rows(); // sponge |
- | |
338 | $val = $res->fetch_object()->id; |
- | |
339 | echo "Natural OID Sorting (128 Bit): " . ($val == 'oid:2.25.67919736312109525688528068157180855579' ? greentext('PASSED') : redtext('FAILED'))."\n"; |
- | |
340 | - | ||
341 | $db->query("delete from ###objects where parent = 'test:1'"); |
- | |
342 | $db->query("insert into ###objects (id, parent, title, description, confidential) values ('abc:3.1.10', 'test:1', '', '', '0')"); |
- | |
343 | $db->query("insert into ###objects (id, parent, title, description, confidential) values ('abc:3.1.2', 'test:1', '', '', '0')"); |
- | |
344 | $res = $db->query("select id from ###objects where parent = ? order by ".$db->natOrder('id'), array('test:1')); |
- | |
345 | //$res->num_rows(); // sponge |
- | |
346 | $val = $res->fetch_object()->id; |
- | |
347 | echo "Non-Natural Sorting for Non-OIDs: " . ($val == 'abc:3.1.10' ? greentext('PASSED') : redtext('FAILED'))."\n"; |
- | |
348 | - | ||
349 | // --- Test insert_id() |
323 | // --- Test insert_id() |
350 | 324 | ||
351 | $db->query("delete from ###log_object where object = 'test:1'"); |
325 | $db->query("delete from ###log_object where object = 'test:1'"); |
352 | $cur = $db->insert_id(); |
326 | $cur = $db->insert_id(); |
353 | echo "Insert ID on non-insert: " . ($cur == 0 ? greentext('PASSED') : redtext('FAILED'))." ($cur)\n"; |
327 | echo "Insert ID on non-insert: " . ($cur == 0 ? greentext('PASSED') : redtext('FAILED'))." ($cur)\n"; |