diff options
author | George Joseph <gjoseph@digium.com> | 2016-10-12 15:30:40 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2016-10-12 15:30:40 -0600 |
commit | 90ae4e433713e866d6745626ae601660a982eee1 (patch) | |
tree | ee755a7189b7470419495a2fb50225c8225fe0a5 /README | |
parent | 3633c7926cdc102570a5f179aae8a9017bd0a034 (diff) |
res_config_mysql: Fix several issues related to recent table changes
Unlike any of the other database drivers, res_config_mysql checks that
the table definition matches the requirements for every insert and
update statement. Since all requirements are forced to 'char', any
column that isn't a char, like ps_contacts' expiration_time,
qualify_timeout, etc., will throw a warning. It's kinda harmless but
very misleading. Since no other driver does those checks on insert
or update, they've been removed from res_config_mysql. Also, all
the logic that actually attempted to ALTER the table to fix the issue
has been removed. With the move to alembic, the auto-alter
functionality is not only unnecessary, it's also dangerous.
The other issue is that res_config_mysql calls the mysql_insert_id
function inside store_mysql. Presumably the intention was to return
the number of rows inserted DESPITE A NOTE IN THE CODE THAT THE VALUE
IS NON_PORTABLE AND MAY CHANGE. That value is then returned to
config realtime as the number of rows inserted. Guess what? The value
changed. It now only returns the number of rows inserted if there's an
auto increment column on the table, which ps_contacts doesn't have.
Otherwise it returns 0. So now, the insert worked but we tell config
realtime and sorcery that no rows were inserted. That call to
mysql_insert_id was removed and we now always return 1 if the insert
succeeded. We're only inserting 1 row at a time anyway. If the insert
fails, we still return -1.
ASTERISK-26362 #close
Reported-by: Carlos Chavez
Change-Id: I83ce633efdb477b03c8399946994ee16fefceaf4
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions