<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have a simple VRT merging data from three Shapefile sources, using an SQLITE query. The command executes without any issues with ogr2ogr v. 2.3.0 dev and with 2.1.3, but fails my new 3.0.1 install.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">ogr2ogr.exe -f "ESRI Shapefile" c:\pathto\test.shp f:\pathto\cis_SGRDAMERGED_20190925_pl_a.vrt<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The VRT is:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""><OGRVRTDataSource><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""><OGRVRTUnionLayer name="test"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <OGRVRTLayer name="cis_SGRDAHA_20190925T1800Z_pl_a"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <SrcSQL dialect="SQLITE">SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAHA_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")</SrcSQL><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <SrcDataSource>F:\pathto\cis_SGRDAHA_20190925T1800Z_pl_a.shp</SrcDataSource><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> </OGRVRTLayer><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <OGRVRTLayer name="cis_SGRDAMID_20190925T1800Z_pl_a"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <SrcSQL dialect="SQLITE">SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAMID_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")</SrcSQL><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <SrcDataSource>F:\pathto\cis_SGRDAMID_20190925T1800Z_pl_a.shp</SrcDataSource><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> </OGRVRTLayer><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <OGRVRTLayer name="cis_SGRDAWA_20190925T1800Z_pl_a"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <SrcSQL dialect="SQLITE">SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAWA_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")</SrcSQL><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> <SrcDataSource>F:\pathto\cis_SGRDAWA_20190925T1800Z_pl_a.shp</SrcDataSource><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""> </OGRVRTLayer><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""></OGRVRTUnionLayer><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New""></OGRVRTDataSource><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">===<o:p></o:p></p>
<p class="MsoNormal">Error:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">ERROR 1: SQL Expression Parsing Error: syntax error, unexpected string, expecting NULL or NOT. Occurred around :<o:p></o:p></p>
<p class="MsoNormal">POLY_TYPE IS 'I' AND CT IS NOT '02' AND CT IS NOT '01<o:p></o:p></p>
<p class="MsoNormal"> ^<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: In ExecuteSQL(): sqlite3_step(SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAHA_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")):<o:p></o:p></p>
<p class="MsoNormal"> Cannot apply attribute filter : POLY_TYPE IS 'I' AND CT IS NOT '02' AND CT IS NOT '01' AND CT IS NOT '00'<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: SQL statement failed, or returned no layer result:<o:p></o:p></p>
<p class="MsoNormal">SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAHA_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: SQL Expression Parsing Error: syntax error, unexpected string, expecting NULL or NOT. Occurred around :<o:p></o:p></p>
<p class="MsoNormal">POLY_TYPE IS 'I' AND CT IS NOT '02' AND CT IS NOT '01<o:p></o:p></p>
<p class="MsoNormal"> ^<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: In ExecuteSQL(): sqlite3_step(SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAMID_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")):<o:p></o:p></p>
<p class="MsoNormal"> Cannot apply attribute filter : POLY_TYPE IS 'I' AND CT IS NOT '02' AND CT IS NOT '01' AND CT IS NOT '00'<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: SQL statement failed, or returned no layer result:<o:p></o:p></p>
<p class="MsoNormal">SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAMID_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: SQL Expression Parsing Error: syntax error, unexpected string, expecting NULL or NOT. Occurred around :<o:p></o:p></p>
<p class="MsoNormal">POLY_TYPE IS 'I' AND CT IS NOT '02' AND CT IS NOT '01<o:p></o:p></p>
<p class="MsoNormal"> ^<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: In ExecuteSQL(): sqlite3_step(SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAWA_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")):<o:p></o:p></p>
<p class="MsoNormal"> Cannot apply attribute filter : POLY_TYPE IS 'I' AND CT IS NOT '02' AND CT IS NOT '01' AND CT IS NOT '00'<o:p></o:p></p>
<p class="MsoNormal">ERROR 1: SQL statement failed, or returned no layer result:<o:p></o:p></p>
<p class="MsoNormal">SELECT GEOMETRY, POLY_TYPE FROM cis_SGRDAWA_20190925T1800Z_pl_a WHERE (POLY_TYPE IS "I") AND (CT IS NOT "00") AND (CT IS NOT "01") AND (CT IS NOT "02")<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any known issues already reported?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#303030;mso-fareast-language:EN-CA">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#303030;mso-fareast-language:EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#303030;mso-fareast-language:EN-CA">Benjamin</span><span lang="FR-CA"><o:p></o:p></span></p>
</div>
</body>
</html>