-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix bug and add test for dba_open same file twice #17979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
3a299f5
1ae93ef
364fb17
6673d73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,34 @@ | ||||||
--TEST-- | ||||||
DBA open same read only file multiple times | ||||||
--EXTENSIONS-- | ||||||
dba | ||||||
--SKIPIF-- | ||||||
<?php | ||||||
require_once __DIR__ . '/setup/setup_dba_tests.inc'; | ||||||
check_skip('cdb_make'); | ||||||
?> | ||||||
--CONFLICTS-- | ||||||
test.cdb | ||||||
--FILE-- | ||||||
<?php | ||||||
echo "database handler: cdb\n"; | ||||||
$handler = 'cdb'; | ||||||
$db_filename = __DIR__.'/test.cdb'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the advantage of having a separate db test file? I double anyone is deleting test.cdb and I thought the name of the db is generic enough for reuse.
chschneider marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
if (($db_file=dba_open($db_filename, "r", $handler))!==FALSE) { | ||||||
echo dba_fetch(1, $db_file); | ||||||
if (($db_file2=dba_open($db_filename, "r", $handler))!==FALSE) { | ||||||
echo dba_fetch(1, $db_file2); | ||||||
echo dba_fetch(2, $db_file2); | ||||||
dba_close($db_file2); | ||||||
} else { | ||||||
echo "Error opening database 2nd time\n"; | ||||||
} | ||||||
echo dba_fetch(2, $db_file); | ||||||
dba_close($db_file); | ||||||
} else { | ||||||
echo "Error opening database\n"; | ||||||
} | ||||||
?> | ||||||
--EXPECT-- | ||||||
database handler: cdb | ||||||
1122 |
Uh oh!
There was an error while loading. Please reload this page.