Repository: alanmcruickshank/sqlfluff

Issue:
PRS Error: Found unparsable segment @L001P008: 'a.b.*...'
SQL query to reproduce:
```sql
SELECT a.b.* FROM t
```

Discussion:

Patch:
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 20c2b820..0e7760be 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,4 +1,4 @@
 # Requirements for building docs
-sphinx==2.4.1
+sphinx==2.3.1
 sphinx-click
 doc8
diff --git a/src/sqlfluff/dialects/dialect_ansi.py b/src/sqlfluff/dialects/dialect_ansi.py
index cea93c05..addb10f1 100644
--- a/src/sqlfluff/dialects/dialect_ansi.py
+++ b/src/sqlfluff/dialects/dialect_ansi.py
@@ -491,8 +491,15 @@ class SelectTargetElementSegment(BaseSegment):
     parse_grammar = OneOf(
         # *
         Ref('StarSegment'),
-        # blah.*
-        Sequence(Ref('SingleIdentifierGrammar'), Ref('DotSegment'), Ref('StarSegment'), code_only=False),
+        # blah.* + blah.blah.*
+        Sequence(
+            Ref('SingleIdentifierGrammar'), Ref('DotSegment'),
+            Sequence(
+                Ref('SingleIdentifierGrammar'), Ref('DotSegment'),
+                optional=True
+            ),
+            Ref('StarSegment'), code_only=False
+        ),
         Sequence(
             OneOf(
                 Ref('LiteralGrammar'),


Test patch:
diff --git a/test/dialects_ansi_test.py b/test/dialects_ansi_test.py
index 91f29dc5..149b5e88 100644
--- a/test/dialects_ansi_test.py
+++ b/test/dialects_ansi_test.py
@@ -81,7 +81,10 @@ def test__dialect__ansi__file_from_raw(raw, res, caplog):
          "CAST(num AS INT64)"),
         # Casting as datatype with arguments
         ("SelectTargetElementSegment",
-         "CAST(num AS numeric(8,4))")
+         "CAST(num AS numeric(8,4))"),
+        # Wildcard field selection
+        ("SelectTargetElementSegment", "a.*"),
+        ("SelectTargetElementSegment", "a.b.*")
     ]
 )
 def test__dialect__ansi_specific_segment_parses(segmentref, raw, caplog):