Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Postgres]: Structure of orderby AST does not match MySQL #1943

Open
tbantle22 opened this issue Jun 7, 2024 · 4 comments
Open

[Postgres]: Structure of orderby AST does not match MySQL #1943

tbantle22 opened this issue Jun 7, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@tbantle22
Copy link
Contributor

tbantle22 commented Jun 7, 2024

Sorry for all the issues - having some trouble migrating to v5 as a lot of our Postgres tests are failing.

Parsing this query for MySQL and Postgres gives a different results structure. These were equivalent pre-v5 and both looked like the MySQL structure. This would be improved if the OrderBy type was not any:

SELECT col1 FROM tablename WHERE col1 = 'value' ORDER BY col2 DESC

MySQL:

{
   "orderby": [
        {
          "expr": {
            "type": "column_ref",
            "table": null,
            "column": "col2"
          },
          "type": "DESC"
        }
      ],
}

Postgres:

{
   "orderby": [
        {
          "expr": {
            "type": "column_ref",
            "table": null,
            "column": {
              "expr": {
                "type": "default",
                "value": "col2"
              }
            }
          },
          "type": "DESC",
          "nulls": null
        }
      ],
}
@taozhi8833998
Copy link
Owner

@tbantle22 I will update MySQL syntax to be compatible with PostgreSQL.

@tbantle22
Copy link
Contributor Author

To clarify, I think both should look like the MySQL syntax

@tbantle22
Copy link
Contributor Author

To clarify, I think both should look like the MySQL syntax

I responded before I read this. As long as the syntax is the same for both MySQL and Postgres that will be a great help

@taozhi8833998
Copy link
Owner

taozhi8833998 commented Jun 12, 2024

@tbantle22 ok got it. Sorry for the break changes.

@taozhi8833998 taozhi8833998 added the enhancement New feature or request label Jun 28, 2024
@taozhi8833998 taozhi8833998 added this to the 5.3.0 milestone Jun 28, 2024
@taozhi8833998 taozhi8833998 modified the milestones: 5.3.0, 5.4.0 Jul 31, 2024
@taozhi8833998 taozhi8833998 modified the milestones: 5.3.1, 5.4.0 Aug 7, 2024
@taozhi8833998 taozhi8833998 modified the milestones: 5.3.2, 5.4.0 Sep 2, 2024
@taozhi8833998 taozhi8833998 modified the milestones: 5.3.3, 5.4.0 Oct 13, 2024
@taozhi8833998 taozhi8833998 modified the milestones: 5.4.0, 5.3.5 Nov 8, 2024
@taozhi8833998 taozhi8833998 modified the milestones: 5.3.5, 5.3.6 Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants