mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
plugins/data: fix if order (nw)
This commit is contained in:
parent
73b4115c19
commit
00b999cbfa
@ -49,7 +49,12 @@ function datfile.open(file, vertag, fixupcb)
|
|||||||
end
|
end
|
||||||
stmt:finalize()
|
stmt:finalize()
|
||||||
|
|
||||||
if not dbver then
|
if not fh and dbver then
|
||||||
|
-- data in database but missing file, just use what we have
|
||||||
|
return read, dbver
|
||||||
|
elseif not fh then
|
||||||
|
return nil
|
||||||
|
elseif not dbver then
|
||||||
db:exec("CREATE TABLE \"" .. file .. [[_idx" (
|
db:exec("CREATE TABLE \"" .. file .. [[_idx" (
|
||||||
type VARCHAR NOT NULL,
|
type VARCHAR NOT NULL,
|
||||||
val VARCHAR NOT NULL,
|
val VARCHAR NOT NULL,
|
||||||
@ -57,11 +62,6 @@ function datfile.open(file, vertag, fixupcb)
|
|||||||
data INTEGER NOT NULL)]])
|
data INTEGER NOT NULL)]])
|
||||||
db:exec("CREATE TABLE \"" .. file .. "\" (data CLOB NOT NULL)")
|
db:exec("CREATE TABLE \"" .. file .. "\" (data CLOB NOT NULL)")
|
||||||
db:exec("CREATE INDEX \"typeval_" .. file .. "\" ON \"" .. file .. "_idx\"(type, val)")
|
db:exec("CREATE INDEX \"typeval_" .. file .. "\" ON \"" .. file .. "_idx\"(type, val)")
|
||||||
elseif not fh then
|
|
||||||
-- data in database but missing file, just use what we have
|
|
||||||
return read, dbver
|
|
||||||
elseif not fh and not dbver then
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if vertag then
|
if vertag then
|
||||||
|
Loading…
Reference in New Issue
Block a user