forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit27ab1eb
committed
Tweak parse location assignment for CURRENT_DATE and related constructs.
All these constructs generate parse trees consisting of a Const anda run-time type coercion (perhaps a FuncExpr or a CoerceViaIO). Modifythe raw parse output so that we end up with the original token's locationattached to the type coercion node while the Const has location -1;before, it was the other way around. This makes no difference in termsof what exprLocation() will say about the parse tree as a whole, so itshould not have any user-visible impact. The point of changing it is thatwe do not want contrib/pg_stat_statements to treat these constructs asreplaceable constants. It will do the right thing if the Const haslocation -1 rather than a valid location.This is a pretty ugly hack, but then this code is ugly already; we shouldsomeday replace this translation with special-purpose parse node(s) thatwould allow ruleutils.c to reconstruct the original query text.(See also commit5d3fcc4, which alsohacked location assignment rules for the benefit of pg_stat_statements.)Back-patch to 9.2 where pg_stat_statements grew the ability to recognizereplaceable constants.Kyotaro Horiguchi1 parent1fe0659 commit27ab1eb
1 file changed
+21
-16
lines changedLines changed: 21 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10851 | 10851 |
| |
10852 | 10852 |
| |
10853 | 10853 |
| |
| 10854 | + | |
| 10855 | + | |
| 10856 | + | |
| 10857 | + | |
| 10858 | + | |
10854 | 10859 |
| |
10855 | 10860 |
| |
10856 |
| - | |
10857 |
| - | |
| 10861 | + | |
| 10862 | + | |
10858 | 10863 |
| |
10859 | 10864 |
| |
10860 | 10865 |
| |
| |||
10863 | 10868 |
| |
10864 | 10869 |
| |
10865 | 10870 |
| |
10866 |
| - | |
10867 |
| - | |
| 10871 | + | |
| 10872 | + | |
10868 | 10873 |
| |
10869 | 10874 |
| |
10870 | 10875 |
| |
| |||
10874 | 10879 |
| |
10875 | 10880 |
| |
10876 | 10881 |
| |
10877 |
| - | |
| 10882 | + | |
10878 | 10883 |
| |
10879 | 10884 |
| |
10880 |
| - | |
| 10885 | + | |
10881 | 10886 |
| |
10882 | 10887 |
| |
10883 | 10888 |
| |
| |||
10904 | 10909 |
| |
10905 | 10910 |
| |
10906 | 10911 |
| |
10907 |
| - | |
| 10912 | + | |
10908 | 10913 |
| |
10909 | 10914 |
| |
10910 |
| - | |
| 10915 | + | |
10911 | 10916 |
| |
10912 | 10917 |
| |
10913 | 10918 |
| |
| |||
10916 | 10921 |
| |
10917 | 10922 |
| |
10918 | 10923 |
| |
10919 |
| - | |
10920 |
| - | |
| 10924 | + | |
| 10925 | + | |
10921 | 10926 |
| |
10922 | 10927 |
| |
10923 | 10928 |
| |
| |||
10927 | 10932 |
| |
10928 | 10933 |
| |
10929 | 10934 |
| |
10930 |
| - | |
| 10935 | + | |
10931 | 10936 |
| |
10932 | 10937 |
| |
10933 |
| - | |
| 10938 | + | |
10934 | 10939 |
| |
10935 | 10940 |
| |
10936 | 10941 |
| |
| |||
10939 | 10944 |
| |
10940 | 10945 |
| |
10941 | 10946 |
| |
10942 |
| - | |
10943 |
| - | |
| 10947 | + | |
| 10948 | + | |
10944 | 10949 |
| |
10945 | 10950 |
| |
10946 | 10951 |
| |
| |||
10950 | 10955 |
| |
10951 | 10956 |
| |
10952 | 10957 |
| |
10953 |
| - | |
| 10958 | + | |
10954 | 10959 |
| |
10955 | 10960 |
| |
10956 |
| - | |
| 10961 | + | |
10957 | 10962 |
| |
10958 | 10963 |
| |
10959 | 10964 |
| |
|
0 commit comments
Comments
(0)