forked from sqlfluff/sqlfluff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AL09.yml
110 lines (98 loc) · 2.27 KB
/
AL09.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
rule: AL09
test_pass_no_alias:
pass_str:
select
col_a,
col_b
from foo
test_pass_no_self_alias:
pass_str:
select
col_a,
col_b as new_col_b
from foo
test_pass_no_self_alias_function:
pass_str:
select
max(sum) as max_sum
from foo
test_fail_self_alias:
fail_str:
select
col_a as col_a,
col_b as new_col_b
from foo
fix_str:
select
col_a,
col_b as new_col_b
from foo
test_fail_self_alias_upper:
fail_str:
select
col_a as COL_A,
col_b as new_col_b
from foo
fix_str:
select
col_a,
col_b as new_col_b
from foo
test_fail_self_alias_implicit:
fail_str:
select
col_a col_a,
col_b AS new_col_b
from foo
fix_str:
select
col_a,
col_b AS new_col_b
from foo
test_fail_self_alias_and_table_aliased:
fail_str:
select
a.col_a as col_a,
a.col_b as new_col_b
from foo as a
fix_str:
select
a.col_a,
a.col_b as new_col_b
from foo as a
test_fail_self_alias_quoted:
fail_str:
select
"col_a" as "col_a",
col_b as new_col_b
from foo
fix_str:
select
"col_a",
col_b as new_col_b
from foo
test_pass_self_alias_case_insensitive:
# Renaming the column name from case-sensitive to case-insensitive
pass_str:
select
"col_a" as col_a,
col_b as new_col_b
from foo
test_pass_self_alias_case_sensitive:
# Renaming the column name from case-insensitive to case-sensitive
pass_str:
select
col_a as "col_a",
col_b as new_col_b
from foo
test_pass_mysql_quoted_identifiers:
pass_str: |
SELECT
users.email AS "Email_in_double_quotes",
users.email AS "Email""with_escaped_double_quotes",
users.email AS `Email_in_backticks`,
users.email AS 'Email_in_single_quotes'
FROM users;
configs:
core:
dialect: mysql