sql-testing-tools 0.2.12__py3-none-any.whl → 0.2.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sql_testing_tools/TokenProcessing.py +6 -2
- {sql_testing_tools-0.2.12.dist-info → sql_testing_tools-0.2.13.dist-info}/METADATA +5 -1
- sql_testing_tools-0.2.13.dist-info/RECORD +9 -0
- sql_testing_tools-0.2.12.dist-info/RECORD +0 -9
- {sql_testing_tools-0.2.12.dist-info → sql_testing_tools-0.2.13.dist-info}/WHEEL +0 -0
- {sql_testing_tools-0.2.12.dist-info → sql_testing_tools-0.2.13.dist-info}/licenses/LICENSE +0 -0
- {sql_testing_tools-0.2.12.dist-info → sql_testing_tools-0.2.13.dist-info}/top_level.txt +0 -0
|
@@ -46,12 +46,16 @@ def _select(select, alias_map, base_dict: dict, insideFunction=False):
|
|
|
46
46
|
else:
|
|
47
47
|
select_tokens.append(f"{_identifier(token, alias_map, base_dict).lower()} as {token.get_real_name().lower()}")
|
|
48
48
|
elif isinstance(token, Function):
|
|
49
|
-
|
|
49
|
+
is_count = False
|
|
50
50
|
for par in token.tokens:
|
|
51
51
|
if isinstance(par, Identifier):
|
|
52
52
|
select_tokens.append(par.get_name().lower()+"(")
|
|
53
|
+
is_count = par.get_name().lower() == "count"
|
|
53
54
|
if isinstance(par, Parenthesis):
|
|
54
|
-
|
|
55
|
+
select_ident = _select(par, alias_map, base_dict, True)
|
|
56
|
+
if is_count and not any(tok.value.upper() == "DISTINCT" for tok in par.tokens):
|
|
57
|
+
select_ident = "*"
|
|
58
|
+
select_tokens[-1] += select_ident +") as funcResult"
|
|
55
59
|
elif token.ttype is Wildcard:
|
|
56
60
|
select_tokens.append("*")
|
|
57
61
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql_testing_tools
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.13
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Requires-Dist: sqlparse>=0.5.1
|
|
@@ -135,9 +135,13 @@ res = checkEquality()
|
|
|
135
135
|
|
|
136
136
|
### Changelog
|
|
137
137
|
|
|
138
|
+
##### V 0.2.13
|
|
139
|
+
- Acccept `COUNT(colname)`, too (instead of just `COUNT(*)`)
|
|
140
|
+
|
|
138
141
|
##### V 0.2.12
|
|
139
142
|
- fixed bug when having only one colum selected
|
|
140
143
|
- fixed bug with nested conditions
|
|
144
|
+
- fixed memory problem with huge cross products (used to lead to build failed)
|
|
141
145
|
|
|
142
146
|
##### V 0.2.11
|
|
143
147
|
- fixed irrelevant equality order if both sides aren't literals
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
sql_testing_tools/BaseAccess.py,sha256=GyRdmiooeeX7FknojGn8nA5oliQ2CoViZYdKHxGv7-8,6365
|
|
2
|
+
sql_testing_tools/Helper.py,sha256=1vxw6e04MK7HqnaPONCH2h0rZqDhgfNFI5z6hJ1pKfU,8998
|
|
3
|
+
sql_testing_tools/TokenProcessing.py,sha256=BzD_mdVT_FPOJQc2KF9pEHp-s3tQ3NUusXTdSDFCW-U,14149
|
|
4
|
+
sql_testing_tools/__init__.py,sha256=eihMp9aizQd5Lnegu0y57WcyCinmy4Jvp66e0fiMPU4,49
|
|
5
|
+
sql_testing_tools-0.2.13.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
6
|
+
sql_testing_tools-0.2.13.dist-info/METADATA,sha256=8e5Eubi2zK0eyOy-l8a2hQuAvP7nAwDH8JQiDiXsEL0,7730
|
|
7
|
+
sql_testing_tools-0.2.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
sql_testing_tools-0.2.13.dist-info/top_level.txt,sha256=qwEkmfJ_lYhIwcLXgfU75m0_JavVbOg96fN2zSatN3E,18
|
|
9
|
+
sql_testing_tools-0.2.13.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
sql_testing_tools/BaseAccess.py,sha256=GyRdmiooeeX7FknojGn8nA5oliQ2CoViZYdKHxGv7-8,6365
|
|
2
|
-
sql_testing_tools/Helper.py,sha256=1vxw6e04MK7HqnaPONCH2h0rZqDhgfNFI5z6hJ1pKfU,8998
|
|
3
|
-
sql_testing_tools/TokenProcessing.py,sha256=c60or405TyLUuVOHLWkkfwKD_WqKGQ7rtArPkMAPvok,13997
|
|
4
|
-
sql_testing_tools/__init__.py,sha256=eihMp9aizQd5Lnegu0y57WcyCinmy4Jvp66e0fiMPU4,49
|
|
5
|
-
sql_testing_tools-0.2.12.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
6
|
-
sql_testing_tools-0.2.12.dist-info/METADATA,sha256=Xm2rulNTFTqDvwAqIzxAhz6RMbSXF38nqesIi2dp6l0,7574
|
|
7
|
-
sql_testing_tools-0.2.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
sql_testing_tools-0.2.12.dist-info/top_level.txt,sha256=qwEkmfJ_lYhIwcLXgfU75m0_JavVbOg96fN2zSatN3E,18
|
|
9
|
-
sql_testing_tools-0.2.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|