]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_config_sqlite3: Properly create missing columns when necessary 69/4969/2
authorSean Bright <sean.bright@gmail.com>
Thu, 16 Feb 2017 11:46:04 +0000 (06:46 -0500)
committerSean Bright <sean.bright@gmail.com>
Thu, 16 Feb 2017 12:09:22 +0000 (07:09 -0500)
commit9b02bbfa882a451846a3ced1b955aca67d5a6b98
tree04773c7187bb05449eb3e57e5f6569405f1088aa
parent73133d5354d5794a99f901532a6516857c3e4831
res_config_sqlite3: Properly create missing columns when necessary

There were two specific issues resolved here:

1) The code that iterated over the required fields
   (via ast_realtime_require) was broken for the RQ_INTEGER1 field
   type. Iteration would stop when the first RQ_INTEGER1 (0) field
   was encountered.

2) sqlite3_changes() was used to try and count the number of rows
   returned by a SELECT statement. sqlite3_changes() only counts
   affected rows, so this was always returning the value from the
   most recent data modification statement. We now separate read-only
   queries from data modification queries and count rows appropriately
   in both cases.

ASTERISK-23457 #close
Reported by: Scott Griepentrog

Change-Id: I91ed20494efc3fcfbc2a96ac7646999a49814884
res/res_config_sqlite3.c