* added the Unlicense as valid in misc/share/REGISTER
[t2sde.git] / package / lua / lua-sqlite3 / map_index.patch
blob7af60a767d24f423ec9b9201b61a7884702f3704
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../lua-sqlite3/map_index.patch
5 # Copyright (C) 2010 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Fixed named parameters with multiple statements (handles) to map correctly.
19 - Rene Rebe <rene@exactcode.de>
21 --- lua-sqlite3-0.4.1/sqlite3.lua.vanilla 2005-09-14 23:22:59.000000000 +0000
22 +++ lua-sqlite3-0.4.1/sqlite3.lua 2010-03-29 13:15:37.936666788 +0000
23 @@ -621,12 +621,14 @@
24 local function bind_by_names(parameters)
25 local parameter_names = stmt.paranames
26 local mapping = stmt.mapping
27 + local map_index = 1
28 for _, handle in ipairs(stmt.handles) do
29 for index = 1, api.bind_parameter_count(handle) do
30 - local status = api.bind(handle, index, parameters[parameter_names[mapping[index]]])
31 + local status = api.bind(handle, index, parameters[parameter_names[mapping[map_index]]])
32 if is_error(status) then
33 return nil, errmsg(stmt.db.handle)
34 end
35 + map_index = map_index + 1
36 end
37 end
38 end