1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

The affinity of the unlikely() function and its cousins should be "none".

Ticket [0c620df60bffd9ef]

FossilOrigin-Name: 614ecb0af47038848e8ba2aed6b92db6f33ddc4aea6361795dbde440380f5a35
This commit is contained in:
drh
2019-06-11 21:02:15 +00:00
parent 42be2ad30b
commit a7d6db6ac0
6 changed files with 31 additions and 14 deletions

View File

@ -153,6 +153,19 @@ do_test func3-5.39 {
db eval {EXPLAIN SELECT unlikely(min(1.0+'2.0',4*11))}
} [db eval {EXPLAIN SELECT min(1.0+'2.0',4*11)}]
# Unlikely() does not preserve the affinity of X.
# ticket https://www.sqlite.org/src/tktview/0c620df60b
#
do_execsql_test func3-5.40 {
SELECT likely(CAST(1 AS INT))=='1';
} 0
do_execsql_test func3-5.41 {
SELECT unlikely(CAST(1 AS INT))=='1';
} 0
do_execsql_test func3-5.41 {
SELECT likelihood(CAST(1 AS INT),0.5)=='1';
} 0
# EVIDENCE-OF: R-23735-03107 The likely(X) function returns the argument
# X unchanged.