The query behavior between a materialized table and a view created from the same source table, which contains LINESTRING and POINT types, is inconsistent when using the BIN() function.
Steps to Reproduce:
1. Create Table t0 and Insert Data
CREATE TABLE t0 (c0 LINESTRING, c1 POINT);
|
INSERT INTO t0 (c0, c1) VALUES
|
(LineFromText('LINESTRING(110.625891 23.647987, 131.761062 -22.036987)'), PointFromText('POINT(-31.973521 -32.253348)')),
|
(LineFromText('LINESTRING(-64.099221 85.347816, 83.476771 49.964253, 67.395816 -68.661706, 89.535845 -60.182826)'), PointFromText('POINT(72.132833 50.949942)')),
|
(LineFromText('LINESTRING(30.138314 30.867908, 36.898225 63.201669, 167.383497 51.478527, 114.171311 55.291141, -88.146277 -78.797587)'), PointFromText('POINT(-90.396609 66.746729)'));
|
2. Create Materialized Table t1 and Query
MariaDB [test]> CREATE TABLE t1 AS (SELECT (BIN(c0)) AS c0 , c1 AS c1 FROM t0 );
|
Query OK, 3 rows affected (0.018 sec)
|
Records: 3 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> SELECT c1 FROM t1 WHERE (CASE WHEN ((c0) > (PointFromText('POINT(159.026499 76.330577)'))) THEN (('WRHVP0tOYN')) ELSE (('8kUtsNTg5m')) END);
|
+---------------------------+
|
| c1 |
|
+---------------------------+
|
| 8?@m @ |
|
| R@eyI@ |
|
| '
|
bVc~nhʯP@ |
|
+---------------------------+
|
3 rows in set, 3 warnings (0.001 sec)
|
3. Create t1 as VIEW instead:
MariaDB [test]> CREATE VIEW t1 AS (SELECT (BIN(c0)) AS c0 , c1 AS c1 FROM t0 );
|
Query OK, 0 rows affected (0.007 sec)
|
|
MariaDB [test]> SELECT c1 FROM t1 WHERE (CASE WHEN ((c0) > (PointFromText('POINT(159.026499 76.330577)'))) THEN (('WRHVP0tOYN')) ELSE (('8kUtsNTg5m')) END);
|
Empty set, 3 warnings (0.005 sec)
|
Expected Behavior:
Both the materialized table (t1) and the view (t1) should return the same result for the SELECT query.
Observed Behavior:
Materialized Table (t1) Query: Returns 3 rows.
View (t1) Query: Returns an empty set, even though the data in the underlying table is identical.
- relates to
-
MDEV-35787
Inconsistent Query Results Between Materialized Table and View with ST_AsGeoJSON and Spatial Data
-
-
Open
There are no comments yet on this issue.
{"report":{"fcp":1713.1999999997206,"ttfb":395.1999999997206,"pageVisibility":"visible","entityId":132269,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"fe14aacb-0238-4bfc-ab30-5d1517f7b7c3","navigationType":0,"readyForUser":1839.0999999996275,"redirectCount":0,"resourceLoadedEnd":1348.2999999998137,"resourceLoadedStart":574.6999999997206,"resourceTiming":[{"duration":45.8000000002794,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":574.6999999997206,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":574.6999999997206,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":620.5,"responseStart":0,"secureConnectionStart":0},{"duration":46,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":575,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":575,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":621,"responseStart":0,"secureConnectionStart":0},{"duration":434.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":575.2999999998137,"connectEnd":575.2999999998137,"connectStart":575.2999999998137,"domainLookupEnd":575.2999999998137,"domainLookupStart":575.2999999998137,"fetchStart":575.2999999998137,"redirectEnd":0,"redirectStart":0,"requestStart":631.5999999996275,"responseEnd":1009.7999999998137,"responseStart":683.2999999998137,"secureConnectionStart":575.2999999998137},{"duration":673.7999999998137,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":576.2999999998137,"connectEnd":576.2999999998137,"connectStart":576.2999999998137,"domainLookupEnd":576.2999999998137,"domainLookupStart":576.2999999998137,"fetchStart":576.2999999998137,"redirectEnd":0,"redirectStart":0,"requestStart":631.6999999997206,"responseEnd":1250.0999999996275,"responseStart":688.2999999998137,"secureConnectionStart":576.2999999998137},{"duration":133.1999999997206,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":576.5,"connectEnd":576.5,"connectStart":576.5,"domainLookupEnd":576.5,"domainLookupStart":576.5,"fetchStart":576.5,"redirectEnd":0,"redirectStart":0,"requestStart":631.7999999998137,"responseEnd":709.6999999997206,"responseStart":706.1999999997206,"secureConnectionStart":576.5},{"duration":133.40000000037253,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":576.5999999996275,"connectEnd":576.5999999996275,"connectStart":576.5999999996275,"domainLookupEnd":576.5999999996275,"domainLookupStart":576.5999999996275,"fetchStart":576.5999999996275,"redirectEnd":0,"redirectStart":0,"requestStart":632.5999999996275,"responseEnd":710,"responseStart":707.1999999997206,"secureConnectionStart":576.5999999996275},{"duration":136.20000000018626,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":576.6999999997206,"connectEnd":576.6999999997206,"connectStart":576.6999999997206,"domainLookupEnd":576.6999999997206,"domainLookupStart":576.6999999997206,"fetchStart":576.6999999997206,"redirectEnd":0,"redirectStart":0,"requestStart":646.0999999996275,"responseEnd":712.8999999999069,"responseStart":710.0999999996275,"secureConnectionStart":576.6999999997206},{"duration":63,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":576.8999999999069,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":576.8999999999069,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":639.8999999999069,"responseStart":0,"secureConnectionStart":0},{"duration":144.40000000037253,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":577.0999999996275,"connectEnd":577.0999999996275,"connectStart":577.0999999996275,"domainLookupEnd":577.0999999996275,"domainLookupStart":577.0999999996275,"fetchStart":577.0999999996275,"redirectEnd":0,"redirectStart":0,"requestStart":650.5999999996275,"responseEnd":721.5,"responseStart":713.2999999998137,"secureConnectionStart":577.0999999996275},{"duration":63.39999999990687,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":577.1999999997206,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":577.1999999997206,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":640.5999999996275,"responseStart":0,"secureConnectionStart":0},{"duration":144.29999999981374,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":577.3999999999069,"connectEnd":577.3999999999069,"connectStart":577.3999999999069,"domainLookupEnd":577.3999999999069,"domainLookupStart":577.3999999999069,"fetchStart":577.3999999999069,"redirectEnd":0,"redirectStart":0,"requestStart":650.7999999998137,"responseEnd":721.6999999997206,"responseStart":714.1999999997206,"secureConnectionStart":577.3999999999069},{"duration":769.2000000001863,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":578.6999999997206,"connectEnd":578.6999999997206,"connectStart":578.6999999997206,"domainLookupEnd":578.6999999997206,"domainLookupStart":578.6999999997206,"fetchStart":578.6999999997206,"redirectEnd":0,"redirectStart":0,"requestStart":947.7999999998137,"responseEnd":1347.8999999999069,"responseStart":1298,"secureConnectionStart":578.6999999997206},{"duration":769.6000000000931,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":578.6999999997206,"connectEnd":578.6999999997206,"connectStart":578.6999999997206,"domainLookupEnd":578.6999999997206,"domainLookupStart":578.6999999997206,"fetchStart":578.6999999997206,"redirectEnd":0,"redirectStart":0,"requestStart":1118.7999999998137,"responseEnd":1348.2999999998137,"responseStart":1318,"secureConnectionStart":578.6999999997206},{"duration":274.09999999962747,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1217,"connectEnd":1217,"connectStart":1217,"domainLookupEnd":1217,"domainLookupStart":1217,"fetchStart":1217,"redirectEnd":0,"redirectStart":0,"requestStart":1450.7999999998137,"responseEnd":1491.0999999996275,"responseStart":1484.5999999996275,"secureConnectionStart":1217}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":161,"responseStart":396,"responseEnd":576,"domLoading":411,"domInteractive":2003,"domContentLoadedEventStart":2003,"domContentLoadedEventEnd":2056,"domComplete":3073,"loadEventStart":3073,"loadEventEnd":3073,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1977.8999999999069},{"name":"bigPipe.sidebar-id.end","time":1978.7999999998137},{"name":"bigPipe.activity-panel-pipe-id.start","time":1978.8999999999069},{"name":"bigPipe.activity-panel-pipe-id.end","time":1988.1999999997206},{"name":"activityTabFullyLoaded","time":2060.5}],"measures":[],"correlationId":"e854f88712039f","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":12,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}