Commit b81cd48
authored
Report correct error for value lists in joins (#156)
Some SQL syntax does not pass a table prefix (atom or string)
In the case of `create_name`, then third param may be a string or atom
prefix ... and in those cases should be treated as a prefix.
However syntax such as `VALUES (...)` will pass in the values list
information as the third tuple. this was causing spurious exceptions
to be thrown, rather than creating the correct table name
Introduce `assert_valid_join` which checks for unsupported join syntax
This improves the error messages for `JOIN VALUES (...) AS` clauses
which were being mistakenly tagged as a table prefixing issue. Now the
user gets a more accurate message.
It also puts all the join syntax checking into a single function which
makes it a bit eaiser to reason about (e.g. that hints, values, etc. are
not OK, but other join constructs are)1 parent c32929c commit b81cd48
File tree
2 files changed
+40
-10
lines changed- lib/ecto/adapters/sqlite3
- test/ecto/adapters/sqlite3/connection
2 files changed
+40
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
| 996 | + | |
| 997 | + | |
997 | 998 | | |
998 | 999 | | |
999 | 1000 | | |
| |||
1014 | 1015 | | |
1015 | 1016 | | |
1016 | 1017 | | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1025 | 1021 | | |
1026 | 1022 | | |
1027 | 1023 | | |
| |||
1035 | 1031 | | |
1036 | 1032 | | |
1037 | 1033 | | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1038 | 1048 | | |
1039 | 1049 | | |
1040 | 1050 | | |
| |||
1909 | 1919 | | |
1910 | 1920 | | |
1911 | 1921 | | |
1912 | | - | |
| 1922 | + | |
1913 | 1923 | | |
1914 | 1924 | | |
1915 | 1925 | | |
| 1926 | + | |
| 1927 | + | |
1916 | 1928 | | |
1917 | 1929 | | |
1918 | 1930 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
138 | 156 | | |
139 | 157 | | |
140 | 158 | | |
| |||
0 commit comments