Repository: tobymao/sqlglot

Issue:
Simple query, wrong tables list
Very simple query, wrong tables list! it considers `activity_id` as a table!

```python
sql='ALTER TABLE ride DROP COLUMN activity_id'
list(sqlglot.parse_one(sql, read='mysql').find_all(sqlglot.exp.Table))
# list(sqlglot.parse_one(sql, read='mysql').find_all(sqlglot.exp.Table))
#  0 = {Table} Table(\n  this=Identifier(this=ride, quoted=False))
#  1 = {Table} Table(\n  this=Identifier(this=activity_id, quoted=False))
```

Hints from issue comments:

Solution patch:
diff --git a/sqlglot/parser.py b/sqlglot/parser.py
index a2f118fb5c..5fa7d1ef13 100644
--- a/sqlglot/parser.py
+++ b/sqlglot/parser.py
@@ -1738,9 +1738,13 @@ def _parse_drop(self, exists: bool = False) -> exp.Drop | exp.Command:
 
         concurrently = self._match_text_seq("CONCURRENTLY")
         if_exists = exists or self._parse_exists()
-        table = self._parse_table_parts(
-            schema=True, is_db_reference=self._prev.token_type == TokenType.SCHEMA
-        )
+
+        if kind == "COLUMN":
+            this = self._parse_column()
+        else:
+            this = self._parse_table_parts(
+                schema=True, is_db_reference=self._prev.token_type == TokenType.SCHEMA
+            )
 
         cluster = self._parse_on_property() if self._match(TokenType.ON) else None
 
@@ -1752,7 +1756,7 @@ def _parse_drop(self, exists: bool = False) -> exp.Drop | exp.Command:
         return self.expression(
             exp.Drop,
             exists=if_exists,
-            this=table,
+            this=this,
             expressions=expressions,
             kind=self.dialect.CREATABLE_KIND_MAPPING.get(kind) or kind,
             temporary=temporary,


Test patch:
diff --git a/tests/test_parser.py b/tests/test_parser.py
index ba1240c4f7..b60d719341 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -879,3 +879,8 @@ def test_odbc_date_literals(self):
             expr = parse_one(sql)
             self.assertIsInstance(expr, exp.Insert)
             self.assertIsInstance(expr.expression.expressions[0].expressions[0], cls)
+
+    def test_drop_column(self):
+        ast = parse_one("ALTER TABLE tbl DROP COLUMN col")
+        self.assertEqual(len(list(ast.find_all(exp.Table))), 1)
+        self.assertEqual(len(list(ast.find_all(exp.Column))), 1)