Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6631e6c

Browse files
committed
Rewrite update_functions.sql to avoid dependency on internal logic of the
optimizer which can vary on version of PG core.
1 parentec2a04a commit6631e6c

File tree

2 files changed

+22
-72
lines changed

2 files changed

+22
-72
lines changed

‎expected/update_functions.out

Lines changed: 12 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -295,40 +295,10 @@ UNION ALL
295295
-- aqo_data_update() testing.
296296
--
297297
-- Populate aqo_data with dump data.
298-
SELECT aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS res
299-
FROM aqo_data_dump
300-
ORDER BY res;
301-
res
302-
-----
303-
t
304-
t
305-
t
306-
t
307-
t
308-
t
309-
t
310-
t
311-
t
312-
t
313-
t
314-
t
315-
t
316-
t
317-
t
318-
t
319-
t
320-
t
321-
t
322-
t
323-
t
324-
t
325-
t
326-
t
327-
t
328-
t
329-
t
330-
(27 rows)
331-
298+
SELECT count(*) AS res1 FROM
299+
aqo_data_dump,
300+
LATERAL aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS ret
301+
WHERE ret \gset
332302
-- Check if data is the same as in source, no result rows expected.
333303
(TABLE aqo_data_dump EXCEPT TABLE aqo_data)
334304
UNION ALL
@@ -338,39 +308,15 @@ UNION ALL
338308
(0 rows)
339309

340310
-- Update aqo_data with dump data.
341-
SELECT aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS res
342-
FROM aqo_data_dump
343-
ORDER BY res;
344-
res
345-
-----
346-
t
347-
t
348-
t
349-
t
350-
t
351-
t
352-
t
353-
t
354-
t
355-
t
356-
t
357-
t
311+
SELECT count(*) AS res2 FROM
312+
aqo_data_dump,
313+
LATERAL aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS ret
314+
WHERE ret \gset
315+
SELECT :res1 = :res2 AS ml_sizes_are_equal;
316+
ml_sizes_are_equal
317+
--------------------
358318
t
359-
t
360-
t
361-
t
362-
t
363-
t
364-
t
365-
t
366-
t
367-
t
368-
t
369-
t
370-
t
371-
t
372-
t
373-
(27 rows)
319+
(1 row)
374320

375321
-- Check if data is the same as in source, no result rows expected.
376322
(TABLE aqo_data_dump EXCEPT TABLE aqo_data)

‎sql/update_functions.sql

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,23 @@ UNION ALL
146146
--
147147

148148
-- Populate aqo_data with dump data.
149-
SELECT aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids)AS res
150-
FROM aqo_data_dump
151-
ORDER BY res;
149+
SELECTcount(*)AS res1FROM
150+
aqo_data_dump,
151+
LATERAL aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids)AS ret
152+
WHERE ret \gset
152153

153154
-- Check if data is the same as in source, no result rows expected.
154155
(TABLE aqo_data_dump EXCEPT TABLE aqo_data)
155156
UNION ALL
156157
(TABLE aqo_data EXCEPT TABLE aqo_data_dump);
157158

158159
-- Update aqo_data with dump data.
159-
SELECT aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids)AS res
160-
FROM aqo_data_dump
161-
ORDER BY res;
160+
SELECTcount(*)AS res2FROM
161+
aqo_data_dump,
162+
LATERAL aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids)AS ret
163+
WHERE ret \gset
164+
165+
SELECT :res1= :res2AS ml_sizes_are_equal;
162166

163167
-- Check if data is the same as in source, no result rows expected.
164168
(TABLE aqo_data_dump EXCEPT TABLE aqo_data)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp