]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_config_sqlite3: Properly create missing columns when necessary 70/4970/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:10:40 +0000 (06:10 -0600)
commitaae969b996eac5726b94d2e4baa5be387542045a
tree7c86d289dcd58435cf69d532b6899aa74d1c5fb7
parenta5e806de08648f31f41cb5de382466fb87149e3c
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