Software / code / prosody
Comparison
plugins/mod_storage_sql.lua @ 8078:60207251863c
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 12 Apr 2017 20:59:18 +0200 |
| parent | 8074:4b403f881176 |
| parent | 8075:a4dd08fd64cf |
| child | 8083:32898a74b9d9 |
comparison
equal
deleted
inserted
replaced
| 8074:4b403f881176 | 8078:60207251863c |
|---|---|
| 487 WHERE "TABLE_NAME" LIKE 'prosody%%' AND ( "CHARACTER_SET_NAME"!='%s' OR "COLLATION_NAME"!='%s_bin' ); | 487 WHERE "TABLE_NAME" LIKE 'prosody%%' AND ( "CHARACTER_SET_NAME"!='%s' OR "COLLATION_NAME"!='%s_bin' ); |
| 488 ]]; | 488 ]]; |
| 489 check_encoding_query = check_encoding_query:format(engine.charset, engine.charset); | 489 check_encoding_query = check_encoding_query:format(engine.charset, engine.charset); |
| 490 -- FIXME Is it ok to ignore the return values from this? | 490 -- FIXME Is it ok to ignore the return values from this? |
| 491 engine:transaction(function() | 491 engine:transaction(function() |
| 492 local result = engine:execute(check_encoding_query); | 492 local result = assert(engine:execute(check_encoding_query)); |
| 493 local n_bad_columns = result:rowcount(); | 493 local n_bad_columns = result:rowcount(); |
| 494 if n_bad_columns > 0 then | 494 if n_bad_columns > 0 then |
| 495 changes = true; | 495 changes = true; |
| 496 if apply_changes then | 496 if apply_changes then |
| 497 module:log("warn", "Found %d columns in prosody table requiring encoding change, updating now...", n_bad_columns); | 497 module:log("warn", "Found %d columns in prosody table requiring encoding change, updating now...", n_bad_columns); |