Hiroshi Inoue [Sun, 3 Apr 2016 04:57:12 +0000 (13:57 +0900)]
The third stricmp() in writeDriverCommoninfo() is useless, because the second one causes the function to return.
SC_get_errormsg() definition is repeated twice in succession.
In info.c:SQLGetInfo(), "len = 0" is unnecessary because len is assigned at the end of the function.
In execute.c:PGAPI_ExecDirect(), flag doesn't need to be set as its value doesn't change.
PODBC_PER_STATEMENT_ROLLBACK is not used.
[patch by Tsunakawa, Takayuki]
Hiroshi Inoue [Sun, 27 Mar 2016 11:57:21 +0000 (20:57 +0900)]
SQLS(G)etDescRecW instead of SQLS(G)etDescRec for Unicode driver.
Hiroshi Inoue [Sat, 2 Apr 2016 02:44:32 +0000 (11:44 +0900)]
There's no msvcrxxx,dll in VC14.
Hiroshi Inoue [Fri, 1 Apr 2016 09:48:06 +0000 (18:48 +0900)]
In Windows the use of external variables timezone, tzname and daylight are deprecated. Use _timezone, _tzname and _daylight instead.
Hiroshi Inoue [Fri, 1 Apr 2016 10:40:46 +0000 (19:40 +0900)]
Fix a parameter unmatch of snprintf.
Hiroshi Inoue [Fri, 1 Apr 2016 03:33:44 +0000 (12:33 +0900)]
LINKMT is not used in the build process. ADDL_INC should be ADD_INC. Just a typo. The CLEAN target doesn't delete .pdb files. [patch by Tsunakawa, Takayuki]
Hiroshi Inoue [Fri, 1 Apr 2016 02:05:53 +0000 (11:05 +0900)]
Fixed a typo.
Hiroshi Inoue [Tue, 29 Mar 2016 12:29:49 +0000 (21:29 +0900)]
The statement linked list is not properly chained, which throws away some statements. [patch by Tsunakawa, Takayuki]
Hiroshi Inoue [Tue, 29 Mar 2016 08:38:06 +0000 (17:38 +0900)]
The existing memory is not freed upon realloc() failure.
PGAPI_BindCol() doesn't check the failure of extend_getdata_info().
[patch by Tsunakawa, Takayuki]
Hiroshi Inoue [Tue, 29 Mar 2016 08:43:28 +0000 (17:43 +0900)]
setup.c:test_connection() calls EN_Constructor() twice, leaking small memory. [patch by tsunakawa, Takayuki]
Hiroshi Inoue [Tue, 29 Mar 2016 08:48:19 +0000 (17:48 +0900)]
Checking a flag bit mistakenly resets other flag bits. [patch by Tsunakawa, Takayuki]
Hiroshi Inoue [Mon, 28 Mar 2016 11:55:52 +0000 (20:55 +0900)]
Correctly judge the SQLSTATE 01S06(Attempt to fetch before the result set returned the first rowset) for SQL_FETCH_PRIOR operations of SQFetchScroll.
Hiroshi Inoue [Mon, 28 Mar 2016 05:24:18 +0000 (14:24 +0900)]
Oops, don't forget to set cmd_fetch_size ( and cache_size) of QResultClass objects.
Hiroshi Inoue [Sat, 26 Mar 2016 13:20:38 +0000 (22:20 +0900)]
Add test declare-block-test.
It contains 3 cases which correspond to bugs introduced in 9.05.0100. They are all in declare/fetch mode.
1. Using block cursors.
2. Scroll BOF -> EOF -> BOF ...
3. When fetching a row "behind" the rowset by "fetch absolute", how many rows can be fetched?
Hiroshi Inoue [Sun, 27 Mar 2016 07:22:37 +0000 (16:22 +0900)]
CHAR causes a compilation error in some environment. Use char instead of CHAR.
Hiroshi Inoue [Sat, 26 Mar 2016 13:25:13 +0000 (22:25 +0900)]
Though I made it possible once to build test suite in a different place other than the source code is, it's not now. I would make it possible again.
Hiroshi Inoue [Fri, 25 Mar 2016 02:55:01 +0000 (11:55 +0900)]
Refine SQLGetData().
1. Unify midtemp and moneytemp.
2. Variable wconverted is no longer needed.
3. Pre_convert for PG_TYPE_BOOL is not needed.
4. It's better to take the same road even in case of pre_convet.
Hiroshi Inoue [Sat, 19 Mar 2016 02:39:08 +0000 (11:39 +0900)]
Correctly handle SQLGetData() when the target type is SQL_C_WCHAR and the buffer is small to get the whole data for some data types such as bool, date, time ... etc.
Hiroshi Inoue [Thu, 17 Mar 2016 09:46:40 +0000 (18:46 +0900)]
Make sure that EOF occurs when 'fetched < fetch requested'.
Hiroshi Inoue [Sun, 20 Mar 2016 05:58:10 +0000 (14:58 +0900)]
Don't forget to update num_total_read field of QResultClass record in case 'fetch 0 rows' after 'move'. This fixes the bug 'When fetching a row "behind" the rowset by "fetch absolute" only the first ones of the result set can be fetched.' reported by Bernhard Goebel.
Hiroshi Inoue [Sat, 5 Mar 2016 09:59:35 +0000 (18:59 +0900)]
Consider decimal_digits of SQL_TIME (and time field of PostgreSQL).
Hiroshi Inoue [Fri, 26 Feb 2016 06:54:54 +0000 (15:54 +0900)]
Fix the bug about MONEY type.
Hiroshi Inoue [Thu, 18 Feb 2016 02:51:04 +0000 (11:51 +0900)]
Correct the detection of eof in useDeclare/fetch mode. This change fixes the bug about fetching prior after scrolling next until eof reported by BenS.
Hiroshi Inoue [Fri, 22 Jan 2016 05:42:00 +0000 (14:42 +0900)]
Don't initialize next_in_cache or rowstart_in_cache info when scrolling (block) cursors in declare/fetch mode. This fixes the bug reported by John Kew.
Hiroshi Inoue [Sat, 27 Feb 2016 02:23:23 +0000 (11:23 +0900)]
Fix NULL dereferences which causes application crash. Patch by Tsunakawa, Takayuki.
Hiroshi Inoue [Wed, 13 Jan 2016 00:53:14 +0000 (09:53 +0900)]
Correct a cast.
Hiroshi Inoue [Thu, 31 Dec 2015 03:05:49 +0000 (12:05 +0900)]
Add support for VC14 build.
Hiroshi Inoue [Thu, 21 Jan 2016 10:39:27 +0000 (19:39 +0900)]
Clear the parsed result before executing simple query so that SQLRowCount() returns a proper result. This fix the bug reported by Walter Willmertinger.
Hiroshi Saito [Fri, 8 Jan 2016 15:46:46 +0000 (00:46 +0900)]
change distfiles.
Hiroshi Saito [Fri, 8 Jan 2016 14:24:39 +0000 (23:24 +0900)]
Prep Release 09.05.0100.
Hiroshi Saito [Fri, 8 Jan 2016 14:20:16 +0000 (23:20 +0900)]
Prep Release 09.05.0100.
release note by Heikki Linnakangas.
Heikki Linnakangas [Mon, 21 Dec 2015 14:25:32 +0000 (16:25 +0200)]
Fix handling of return value in {? = CALL ... } syntax.
When sending the query to the server, need to use the number of parameters
calculated by build_libpq_bind_params(), which excludes the OUT parameter,
rather than the original number of parameters. The branch that executes
an already prepared statement got this right.
There was one test query for the CALL syntax already, but it was commented
out, because it doesn't work for unrelated issues. Add a simpler test case
that does work.
This was broken by commit
e6d7ded, in version 09.03.0400. The code was
heavily refactored in commit
e85fbb24, but that refactoring failed to fix
this issue.
Reported by Haribabu Kommi.
Heikki Linnakangas [Mon, 21 Dec 2015 12:52:38 +0000 (14:52 +0200)]
Let the server decide if SQL_LONGVARBINARY means a bytea or large object.
This reverts the behaviour of SQL_LONGVARBINARY parameters to the way it was
before commit
1ccd04c70b8037b268eefcaae09ce131c8c33b59. We can't reliably
guess in the driver whether the parameters should be sent to the server
as 'bytea' or as a large object, so send it as 'unknown' and let the server
decide.
Diagnosis and original patch by Hiroshi Inoue, I only added the comment.
Heikki Linnakangas [Mon, 21 Dec 2015 12:01:57 +0000 (14:01 +0200)]
Fix SQL_DATA_AT_EXEC processing for large objects.
Hiroshi Inoue identified another bug with large objects, with
ByteaAsLongVarBinary=1, but I'll deal with that separately.
Reported by Vadym Krevs.
Hiroshi Inoue [Sun, 6 Dec 2015 10:42:17 +0000 (19:42 +0900)]
Call dumpbin recursively so that indirectly linked dlls can be detected.
For example, when libintl-8.dll links libiconv-2.dll, the installer has to
install libiconv-2.dll as well.
Hiroshi Inoue [Fri, 20 Nov 2015 11:58:36 +0000 (20:58 +0900)]
Correct the precision of a timestamp representation.
Hiroshi Inoue [Sun, 29 Nov 2015 00:09:42 +0000 (09:09 +0900)]
Oops, PROCESSOR_ARCHITECTURE of 64bit OS is AMD64 not x64.
Hiroshi Inoue [Mon, 23 Nov 2015 11:48:52 +0000 (20:48 +0900)]
Remove an unrefereced variable.
Hiroshi Inoue [Mon, 23 Nov 2015 23:09:04 +0000 (08:09 +0900)]
It's not good to pass path name of files in system folder to candle.exe because the file redirection may occur. Instead we specify system folder's name at .wxs.
Hiroshi Inoue [Sat, 21 Nov 2015 00:43:53 +0000 (09:43 +0900)]
Remove useless statements.
Hiroshi Inoue [Sat, 14 Nov 2015 04:19:05 +0000 (13:19 +0900)]
If libpq needs different version of MSVC runtime from that psqlodbc
needs, install it also.
Hiroshi Inoue [Fri, 13 Nov 2015 12:49:15 +0000 (21:49 +0900)]
Improve the way to intall libpq related modules.
Instead of describing fixed items in a .wxs file, automatically detect
what modules to be installed.
Heikki Linnakangas [Mon, 9 Nov 2015 14:03:47 +0000 (16:03 +0200)]
Improve parsing of INSERT INTO statements to support @@identity
Patch by Christian Ullrich, some extra comments and regression test by me.
Heikki Linnakangas [Mon, 9 Nov 2015 13:27:08 +0000 (15:27 +0200)]
Set an error message when password is required to connect.
In previous versions, if a connection fails because the server requires a
password and no password was supplied, you got a "fe_sendauth: no password
supplied" message from SQLGetDiagField(). That got lost at some point, so
put it back, as "Password required".
Per report from "PSequel Support".
Heikki Linnakangas [Wed, 23 Sep 2015 07:14:10 +0000 (10:14 +0300)]
Remove obsolete references to pg_regress from README.txt.
The regression tests no longer use pg_regress, since commit
2002b71d.
Heikki Linnakangas [Tue, 22 Sep 2015 12:36:02 +0000 (15:36 +0300)]
Fix buffer overrun in constructing error message.
If the server returned an error longer than 4096 bytes, we would overrun
the buffer by two bytes. If you're unlucky, that could lead to a crash,
and it consistently did on Windows.
Per report from Andrus Moor.
Heikki Linnakangas [Fri, 26 Jun 2015 15:49:56 +0000 (18:49 +0300)]
Fix autoconf test for whether SQLColAttribute's argument is SQLLEN *.
There was a spurious < character, which made it fail with some compilers.
While we're at it, reformat, add a "checking for" message for that test,
make it a bit more robust by defining the function's body and using the
pointer too.
Per report from Mark Hellegers
Heikki Linnakangas [Tue, 23 Jun 2015 13:48:31 +0000 (16:48 +0300)]
Release critical section if SQLAllocHandle() fails.
Heikki Linnakangas [Wed, 6 May 2015 23:19:45 +0000 (02:19 +0300)]
Don't define strlcat prototype if the system has strlcat()
The #ifdef was wrong.
Hopefully this fixes the build failure on OS X Maverick that Alex Dunn
reported.
Heikki Linnakangas [Wed, 6 May 2015 22:47:23 +0000 (01:47 +0300)]
Silence compiler warning about unused variable
Heikki Linnakangas [Thu, 9 Apr 2015 18:52:19 +0000 (21:52 +0300)]
Fix description of error in comments.
I misunderstood the search_path and current_schema() issue.
current_schema() works fine if search_path contains more than one element.
It just returns the first one in that case. However, I set the search_path
to an invalid value, which just happened to look valid.
Heikki Linnakangas [Thu, 9 Apr 2015 18:46:45 +0000 (21:46 +0300)]
Fix segfault when "SELECT current_schema()" returns NULL.
current_schema() can be NULL, for example if search_path contains more
than one schema. CC_get_current_schema() segfaulted on that. Also fix all
the callers to expect that CC_get_current_schema() can return NULL.
Per report from Frank van der Aa.
Heikki Linnakangas [Wed, 25 Feb 2015 09:17:44 +0000 (11:17 +0200)]
Initialize parameter type of NULL parameters correctly.
When building the arrays of parameter types, formats, etc. for sending to
the server with PQexecParams(), the parameter types for NULL parameters
were not set. This caused "cache lookup failed for type XXX" errors.
Add test case for SQLBindParameter with NULL params.
Heikki Linnakangas [Fri, 6 Feb 2015 15:39:53 +0000 (17:39 +0200)]
Fix regression test to use correct CHECK macro
Heikki Linnakangas [Mon, 2 Feb 2015 22:41:48 +0000 (00:41 +0200)]
Fix typo in connection string used in regression test.
Heikki Linnakangas [Mon, 2 Feb 2015 22:15:10 +0000 (00:15 +0200)]
Fix minor memory leaks.
Per Coverity warnings.
Heikki Linnakangas [Mon, 2 Feb 2015 20:46:30 +0000 (22:46 +0200)]
Remove dead code in ColAttSet.
This is dead code because the caller of ColAttSet never passes 'rti' as
NULL.
Spotted by Coverity. Patch by Michael Paquier.
Heikki Linnakangas [Mon, 2 Feb 2015 20:44:37 +0000 (22:44 +0200)]
Remove dead code
Spotted by Coverity. Patch by Michael Paquier.
Heikki Linnakangas [Mon, 2 Feb 2015 20:31:11 +0000 (22:31 +0200)]
Remove dead code.
Pointed out by Coverity as 13523.
Michael Paquier
Heikki Linnakangas [Mon, 2 Feb 2015 20:25:48 +0000 (22:25 +0200)]
Remove some dead code.
gpps.h was removed back in 2004.
Heikki Linnakangas [Mon, 26 Jan 2015 07:01:29 +0000 (09:01 +0200)]
Refactor regression tests to use a custom program instead of pg_regress.
Using pg_regress was awkward, because it used a dummy .sql file for each
test that just launched the test program. Also, it added a dependency;
the driver doesn't require PostgreSQL sources to build, just libpq
headers, but the pgxs program is not usually shipped with libpq headers.
The new "runsuite" program runs all the test programs given on the command
line, compares the results with the expected output, and produces
TAP-compatible output. It can be run stand-alone, as the TAP output is
human-readable, or with the perl 'prove' program which gives more pretty
output.
Heikki Linnakangas [Mon, 2 Feb 2015 18:30:50 +0000 (20:30 +0200)]
Use _MSC_VER to check for existence of isinf/isnan.
Let's use this variant of the check that's also used in the main PostgreSQL
sources. It has been shown to work, so should be more robust.
Per suggestions from Michael Paquier and Tom Lane.
Heikki Linnakangas [Thu, 29 Jan 2015 12:48:46 +0000 (14:48 +0200)]
A better fix for isnan() and isinf() on Windows.
Newer versions of Visual Studio actually have isnan() and isinf() macros.
Silence compiler warnings about redefining them.
Heikki Linnakangas [Thu, 29 Jan 2015 12:35:28 +0000 (14:35 +0200)]
Fix typo in README.
Michael Paquier
Heikki Linnakangas [Thu, 29 Jan 2015 12:29:40 +0000 (14:29 +0200)]
Fix crash when a query is described, without binding params.
Add test case for the same.
Heikki Linnakangas [Thu, 29 Jan 2015 12:14:38 +0000 (14:14 +0200)]
Don't do premature execution.
Use protocol v3 Parse instead, even in UseServerSidePrepare=0 mode.
Remove the DisallowPremature config option.
Heikki Linnakangas [Thu, 29 Jan 2015 11:32:54 +0000 (13:32 +0200)]
Fix building on Windows systems without isinf()/isnan().
Michael Paquier
Heikki Linnakangas [Wed, 28 Jan 2015 17:46:10 +0000 (19:46 +0200)]
Remove unused variable.
Left over from the switch to PQconnectdbParams.
Heikki Linnakangas [Wed, 28 Jan 2015 14:36:45 +0000 (16:36 +0200)]
Cleanup after test, to silence Valgrind warnings about leaked memory.
Heikki Linnakangas [Wed, 28 Jan 2015 14:16:50 +0000 (16:16 +0200)]
Use PQconnectdbParams for connecting.
This makes it unnecessary to build a connection string, which was broken
anyway. (Try connecting with a username that contains a single quote and
a space).
Heikki Linnakangas [Wed, 28 Jan 2015 14:04:12 +0000 (16:04 +0200)]
Simplify the way the connection string is built.
Heikki Linnakangas [Wed, 28 Jan 2015 12:56:57 +0000 (14:56 +0200)]
Silence Coverity warning about unsafe use of strcpy
We know that pg_attribute.attnum value is an integer that fits in 16 bytes,
but Coverity doesn't. And of course it's nicer to not crash if the backend
is crazy and returns garbage..
Heikki Linnakangas [Wed, 28 Jan 2015 12:47:03 +0000 (14:47 +0200)]
Use fixed-width fields for SQLState values.
I'm hoping that this silences a Coverity warning, making it realize that
none of the strings in the array are longer than 5 bytes.
Heikki Linnakangas [Wed, 28 Jan 2015 12:34:54 +0000 (14:34 +0200)]
Silence Coverity warnings about derefencing NULL pointer.
Heikki Linnakangas [Wed, 28 Jan 2015 12:15:32 +0000 (14:15 +0200)]
Fix parsing of escaped quotes.
The driver-side SQL parsing code didn't recognize quotes and double-quotes
escaped by doubling them correctly. Also add a test case that fails without
this fix.
Heikki Linnakangas [Wed, 28 Jan 2015 11:21:54 +0000 (13:21 +0200)]
Disable LF <-> LF+CR conversion in the param-conversions test.
This silences a silly regression failure on Windows. There is a separate
test for LFConversion, so let's just rely on that.
Heikki Linnakangas [Tue, 27 Jan 2015 18:26:05 +0000 (20:26 +0200)]
Make boolsaschar test case insensitive to whether text maps to CHAR or WCHAR.
There's no need to print the type of the text column, it's not what
boolsaschar test case is testing.
This fixes regression failure on Windows with Unicode driver.
Heikki Linnakangas [Tue, 27 Jan 2015 17:57:11 +0000 (19:57 +0200)]
Use a larger buffer for error message.
This allows us to get a large NOTICE message. The driver limitation that the
comment in notice-test.c talks about has been lifted, remove comment.
Heikki Linnakangas [Tue, 27 Jan 2015 16:59:31 +0000 (18:59 +0200)]
Remove unneeded tests from configure script.
Heikki Linnakangas [Tue, 27 Jan 2015 16:40:55 +0000 (18:40 +0200)]
Teach deprecated-test regression test about keyset-type cursors.
Also use SQL_CURSOR_TYPE instead of SQL_ATTR_CURSOR_TYPE in the
SQLSetStmtOption calls. Although they both have the same value,
SQL_CURSOR_TYPE is what it used to be called back when SQLSetStmtOption
was not deprecated yet, so that's what a genuinely old application would
use.
Heikki Linnakangas [Tue, 27 Jan 2015 15:38:57 +0000 (17:38 +0200)]
The printf() output format of infinite/nan doubles varies across platforms.
Notably, it's different on Windows. Check for infinite/nan values explicitly
in the regression test, to avoid platform-dependent output.
Heikki Linnakangas [Tue, 27 Jan 2015 14:18:10 +0000 (16:18 +0200)]
Windows _snprintf is not a drop-in replacement for POSIX snprintf()
It handles truncation differently. Witnessed by failures in the
result-conversions regression test on Windows. Create a shim function that
uses _snprintf() to implement the POSIX truncation behavior (as long as you
don't run out of memory...)
Heikki Linnakangas [Tue, 27 Jan 2015 12:21:14 +0000 (14:21 +0200)]
Use correct handle when getting error message in regression test.
I hadn't noticed that the error message on procedure call didn't complain
about the invalid function. Also, on Windows, apparently the error message
isn't automatically copied from statement to connection handle, because
I got a diff.
Heikki Linnakangas [Tue, 27 Jan 2015 12:17:27 +0000 (14:17 +0200)]
Teach SQLDriverConnect that Port is no longer required.
This caused SQLDriverConnect to unnecessarily fail or open a connection
options dialog if no Port was specified.
Heikki Linnakangas [Mon, 26 Jan 2015 16:36:49 +0000 (18:36 +0200)]
Remove dead code.
Also move some stuff that's not used elsewhere into multibyte.c
Heikki Linnakangas [Mon, 26 Jan 2015 16:30:59 +0000 (18:30 +0200)]
Remove dead NULL-check.
Per Coverity warning, res-keyset is accessed earlier, so can't be NULL.
Heikki Linnakangas [Mon, 26 Jan 2015 16:25:39 +0000 (18:25 +0200)]
Don't crash on NULL result from CC_send_query
Per Coverity warning. There are probably dozens more cases like this that
it doesn't happen to warn aboute, but let's reduce the noise anyway.
Heikki Linnakangas [Mon, 26 Jan 2015 16:20:43 +0000 (18:20 +0200)]
Fix memory overrun bug with large keyset-driven result sets.
The address passed to memset() was bogus, resulting in clobbering random
piece of memory.
Found by Coverity. Add a somewhat contrived test case for this too.
Heikki Linnakangas [Mon, 26 Jan 2015 15:53:12 +0000 (17:53 +0200)]
Remove a few more unnecessary NULL-checks.
The only caller to QR_next_tuple always passed non-NULL.
Heikki Linnakangas [Mon, 26 Jan 2015 15:49:09 +0000 (17:49 +0200)]
Remove unnecessary null-check.
Per Coverity warning.
Heikki Linnakangas [Mon, 26 Jan 2015 07:49:00 +0000 (09:49 +0200)]
loadlib.c is only needed on Windows.
Heikki Linnakangas [Mon, 26 Jan 2015 07:30:01 +0000 (09:30 +0200)]
Remove dead function.
Heikki Linnakangas [Mon, 26 Jan 2015 06:57:09 +0000 (08:57 +0200)]
Use test -x rather than test -f to check the [i]odbc_config program.
I copied the odbc_config_dummy version from the Debian system, but forgot
to make the script executable. Configure failed, but it didn't complain
about odbc_config, but it claimed that "libpq-fe.h" could not be found.
Turns out that it tried to execute odbc_config --include-prefix, which
failed, leaving the variable empty. In subsequent tests, it ran gcc like
"gcc -I -I/usr/include/postgresql". With this fix, you'll get an error
about odbc_config.
Heikki Linnakangas [Fri, 23 Jan 2015 19:27:57 +0000 (21:27 +0200)]
Fix miscellaneous little issues spotted by Coverity.
A few were real bugs, although highly unlikely ones. Others were false
positives like dead code, but let's be tidy.
Heikki Linnakangas [Fri, 23 Jan 2015 18:01:01 +0000 (20:01 +0200)]
Remove unnecessary argument from schema_strcat1 and my_strcat1.
The length was always passed as SQL_NTS.
Heikki Linnakangas [Fri, 23 Jan 2015 17:04:21 +0000 (19:04 +0200)]
Fix test case to work with standards_conforming_strings=off.
Heikki Linnakangas [Fri, 23 Jan 2015 16:54:31 +0000 (18:54 +0200)]
With standards_conforming_strings=off, one \ in LIKE pattern becomes four.
You could get a segfault if the pattern contained a lot of \ characters.
Add test case for the bug.
Heikki Linnakangas [Fri, 23 Jan 2015 15:40:34 +0000 (17:40 +0200)]
Check return values of a few function calls.
While we're at it, fix spelling of the error messages.
Clang static analyzer complained.
Heikki Linnakangas [Fri, 23 Jan 2015 14:41:15 +0000 (16:41 +0200)]
Silence a few harmless warnings that clang static analyzer gave.
Heikki Linnakangas [Fri, 23 Jan 2015 14:27:18 +0000 (16:27 +0200)]
Fix bug in detection of E'' literals.
The code assigned to escape_in_literal local variable when it saw a quote
characeter after E. And checked the local variable on subsequent iterations.
But the function is called separately for each processed characters, so the
local variable was reset between each call. Move the flag to the QueryParse
struct so that it survives across calls.
Expand the 'quotes' test case to cover this.
Clang Static Analyzer warned that the escape_in_literal variable was set
but not used, which lead me into looking at this more closely.