summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/util-sql.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2016-10-19 23:19:58 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-10-19 23:19:58 +0200
commit9e2c13b12ff90635be145c6c02e21d6e9583037f (patch)
treeaa2dded4f0c97347381d72299cf93b6c3e4b80dd /tex/context/base/mkiv/util-sql.lua
parentd273e996892fcf539d67c9548c90d96c2877507a (diff)
downloadcontext-9e2c13b12ff90635be145c6c02e21d6e9583037f.tar.gz
2016-10-19 22:59:00
Diffstat (limited to 'tex/context/base/mkiv/util-sql.lua')
-rw-r--r--tex/context/base/mkiv/util-sql.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/tex/context/base/mkiv/util-sql.lua b/tex/context/base/mkiv/util-sql.lua
index a0578f086..09056c048 100644
--- a/tex/context/base/mkiv/util-sql.lua
+++ b/tex/context/base/mkiv/util-sql.lua
@@ -240,8 +240,9 @@ local function validspecification(specification)
setmetatable(specification,defaults)
end
local templatefile = specification.templatefile or "query"
- local queryfile = specification.queryfile or presets.queryfile or file.nameonly(templatefile) .. "-temp.sql"
- local resultfile = specification.resultfile or presets.resultfile or file.nameonly(templatefile) .. "-temp.dat"
+ local name = file.nameonly(templatefile)
+ local queryfile = specification.queryfile or presets.queryfile or format("%s-temp.sql",name)
+ local resultfile = specification.resultfile or presets.resultfile or format("%s-temp.dat",name)
specification.queryfile = queryfile
specification.resultfile = resultfile
if trace_sql then
@@ -338,9 +339,9 @@ function sql.usedatabase(presets,datatable)
local queryfile = presets.queryfile or format("%s-temp.sql",name)
local resultfile = presets.resultfile or format("%s-temp.dat",name)
execute = function(specification) -- variables template
- if not specification.presets then specification.presets = presets end
- if not specification.queryfile then specification.queryfile = queryfile end
- if not specification.resultfile then specification.resultfile = queryfile end
+ if not specification.presets then specification.presets = presets end
+ if not specification.queryfile then specification.queryfile = queryfile end
+ if not specification.resultfile then specification.resultfile = resultfile end
return m_execute(specification)
end
else