Repository: andialbrecht/sqlparse

Issue:
`DIV` should be Operator
`DIV` should be treated as Operator, but it isn't.
https://www.w3schools.com/sql/func_mysql_div.asp

This behavior prevents to get_alias with `DIV` operator.

## Actual behavior

```py
>>> sqlparse.parse('col1 DIV 5')[0]._pprint_tree()
|- 0 Identifier 'col1 D...'
|  |- 0 Name 'col1'
|  |- 1 Whitespace ' '
|  `- 2 Identifier 'DIV'
|     `- 0 Name 'DIV'
|- 1 Whitespace ' '
`- 2 Integer '5'
```

## Expected behavior

```py
>>> sqlparse.parse('col1 DIV 5')[0]._pprint_tree()
`- 0 Operation 'col1 D...'
   |- 0 Identifier 'col1'
   |  `- 0 Name 'col1'
   |- 1 Whitespace ' '
   |- 2 Operator 'DIV'
   |- 3 Whitespace ' '
   `- 4 Integer '5'
```


Discussion:

Patch:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 82f63a6..1cde398 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -39,11 +39,11 @@ jobs:
 
     steps:
     - name: Checkout repository
-      uses: actions/checkout@v2
+      uses: actions/checkout@v3
 
     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
+      uses: github/codeql-action/init@v2
       with:
         languages: ${{ matrix.language }}
         # If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
     # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
     # If this step fails, then you should remove it and run the build manually (see below)
     - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
+      uses: github/codeql-action/autobuild@v2
 
     # ℹ️ Command-line programs to run using the OS shell.
     # 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
     #   make release
 
     - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
+      uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml
index b23198d..4f16585 100644
--- a/.github/workflows/python-app.yml
+++ b/.github/workflows/python-app.yml
@@ -15,28 +15,22 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
+        python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v2
+      uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-version }}
     - name: Install dependencies
       run: |
         python -m pip install --upgrade pip
-        pip install flake8 pytest pytest-cov codecov
+        pip install codecov flake8 pytest pytest-cov
         if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
     - name: Lint with flake8
-      run: |
-        # stop the build if there are Python syntax errors or undefined names
-        flake8 sqlparse --count --select=E9,F63,F7,F82 --show-source --statistics
-        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
-        flake8 sqlparse --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+      run: flake8 sqlparse --count --max-complexity=31 --show-source --statistics
     - name: Test with pytest
-      run: |
-        pytest --cov=sqlparse
+      run: pytest --cov=sqlparse
     - name: Publish to codecov
-      run: |
-        codecov
+      run: codecov
diff --git a/AUTHORS b/AUTHORS
index 2e31ae0..bd3d9b8 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,6 +16,7 @@ Alphabetical list of contributors:
 * atronah <atronah.ds@gmail.com>
 * casey <casey@cloudera.com>
 * Cauê Beloni <cbeloni@gmail.com>
+* Christian Clauss <cclauss@me.com>
 * circld <circld1@gmail.com>
 * Corey Zumar <corey.zumar@databricks.com>
 * Cristian Orellana <cristiano@groupon.com>
diff --git a/CHANGELOG b/CHANGELOG
index fb66ab5..ab624fd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,9 @@
 Development Version
 -------------------
 
-Nothing yet.
+Other
+
+* Update github actions to test on Python 3.10 as well (pr661, by cclaus).
 
 
 Release 0.4.2 (Sep 10, 2021)
diff --git a/README.rst b/README.rst
index a840886..df4e7e3 100644
--- a/README.rst
+++ b/README.rst
@@ -4,6 +4,7 @@ python-sqlparse - Parse SQL statements
 |buildstatus|_
 |coverage|_
 |docs|_
+|packageversion|_
 
 .. docincludebegin
 
@@ -59,7 +60,7 @@ Documentation
    https://sqlparse.readthedocs.io/
 
 Online Demo
-  https://sqlformat.org/
+   https://sqlformat.org/
 
 
 sqlparse is licensed under the BSD license.
@@ -73,3 +74,5 @@ pygments-Homepage: http://pygments.org/
 .. _coverage: https://codecov.io/gh/andialbrecht/sqlparse
 .. |docs| image:: https://readthedocs.org/projects/sqlparse/badge/?version=latest
 .. _docs: https://sqlparse.readthedocs.io/en/latest/?badge=latest
+.. |packageversion| image:: https://img.shields.io/pypi/v/sqlparse?color=%2334D058&label=pypi%20package
+.. _packageversion: https://pypi.org/project/sqlparse
diff --git a/setup.cfg b/setup.cfg
index a9127c0..0843b70 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -20,6 +20,7 @@ classifiers =
     Programming Language :: Python :: 3.7
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
+    Programming Language :: Python :: 3.10
     Programming Language :: Python :: Implementation :: CPython
     Programming Language :: Python :: Implementation :: PyPy
     Topic :: Database
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py
index 6850628..f2c24fb 100644
--- a/sqlparse/keywords.py
+++ b/sqlparse/keywords.py
@@ -241,6 +241,7 @@ KEYWORDS = {
     'DISABLE': tokens.Keyword,
     'DISCONNECT': tokens.Keyword,
     'DISPATCH': tokens.Keyword,
+    'DIV': tokens.Operator,
     'DO': tokens.Keyword,
     'DOMAIN': tokens.Keyword,
     'DYNAMIC': tokens.Keyword,
@@ -314,7 +315,7 @@ KEYWORDS = {
     'INCREMENT': tokens.Keyword,
     'INDEX': tokens.Keyword,
 
-    'INDITCATOR': tokens.Keyword,
+    'INDICATOR': tokens.Keyword,
     'INFIX': tokens.Keyword,
     'INHERITS': tokens.Keyword,
     'INITIAL': tokens.Keyword,


Test patch:
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 513b4be..caba537 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -132,6 +132,12 @@ def test_parse_nested_function():
     assert type(t[0]) is sql.Function
 
 
+def test_parse_div_operator():
+    p = sqlparse.parse('col1 DIV 5 AS div_col1')[0].tokens
+    assert p[0].tokens[0].tokens[2].ttype is T.Operator
+    assert p[0].get_alias() == 'div_col1'
+
+
 def test_quoted_identifier():
     t = sqlparse.parse('select x.y as "z" from foo')[0].tokens
     assert isinstance(t[2], sql.Identifier)