Software /
code /
prosody
Comparison
plugins/mod_storage_sql.lua @ 4309:7ad81d81f5ec
mod_storage_sql: Fix commit c806a599224a for compatibility with non-MySQL databases (thanks Ognyan Kulev)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 05 Jun 2011 11:53:29 +0100 |
parent | 4297:3421dfaa8188 |
child | 4317:5b0fcc5cdd4d |
comparison
equal
deleted
inserted
replaced
4308:50e1a3dc2b50 | 4309:7ad81d81f5ec |
---|---|
91 commit_ok, commit_err = connection:commit(); | 91 commit_ok, commit_err = connection:commit(); |
92 end | 92 end |
93 if not(ok and commit_ok) then | 93 if not(ok and commit_ok) then |
94 module:log("warn", "Failed to create index (%s), lookups may not be optimised", err or commit_err); | 94 module:log("warn", "Failed to create index (%s), lookups may not be optimised", err or commit_err); |
95 end | 95 end |
96 else -- COMPAT: Upgrade tables from 0.8.0 | 96 elseif params.driver == "MySQL" then -- COMPAT: Upgrade tables from 0.8.0 |
97 -- Failed to create, but check existing MySQL table here | 97 -- Failed to create, but check existing MySQL table here |
98 local stmt = connection:prepare("SHOW COLUMNS FROM prosody WHERE Field='value' and Type='text'"); | 98 local stmt = connection:prepare("SHOW COLUMNS FROM prosody WHERE Field='value' and Type='text'"); |
99 local ok = stmt:execute(); | 99 local ok = stmt:execute(); |
100 local commit_ok = connection:commit(); | 100 local commit_ok = connection:commit(); |
101 if ok and commit_ok then | 101 if ok and commit_ok then |