Commit 802d7e6
committed
sql: fix placeholder type checking
Previously, an binary expression with two placeholders could be
incorrectly typed in a prepared statement. The issue could occur when
one placeholder had an `UNKNOWN` type hint and one with a non-ambiguous
type hint, e.g., `INT`, `DECIMAL`, etc. The `UNKNOWN` type hint could
take precedence over the non-ambiguous type. This could cause incorrect
results in some cases.
The bug has been fixed by preferring non-ambiguous type hints over
ambiguous ones.
Fixes #152664
Release note (bug fix): A bug in type-checking placeholders with
`UNKNOWN` types has been fixed. It could cause incorrect results in some
cases.1 parent 287999c commit 802d7e6
File tree
2 files changed
+24
-1
lines changed- pkg/sql
- logictest/testdata/logic_test
- sem/tree
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1741 | 1741 | | |
1742 | 1742 | | |
1743 | 1743 | | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2991 | 2991 | | |
2992 | 2992 | | |
2993 | 2993 | | |
2994 | | - | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
2995 | 2997 | | |
2996 | 2998 | | |
2997 | 2999 | | |
| |||
0 commit comments