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

Fix all dictionnaries about MySQL and MariaDB versions for built-in functions #572

Conversation

niconoe-
Copy link
Contributor

@niconoe- niconoe- commented Aug 8, 2024

After long hours and hours of reviewing, I can share to you an up-to-date version of the dictionnaries for all MariaDB and MySQL versions currently supported on SQL-Parser 5.9.

Here are my sources:

MySQL

MySQL 5.0: https://downloads.mysql.com/docs/refman-5.0-en.pdf Chapter 12.1
MySQL 5.1: https://downloads.mysql.com/docs/refman-5.1-en.pdf Chapter 12.1
MySQL 5.5: https://downloads.mysql.com/docs/refman-5.5-en.pdf Chapter 12.1
MySQL 5.6: https://web.archive.org/web/20221203223707/https://dev.mysql.com/doc/refman/5.6/en/built-in-function-reference.html
MySQL 5.7: https://dev.mysql.com/doc/refman/5.7/en/built-in-function-reference.html
MySQL 8.0: https://dev.mysql.com/doc/refman/8.0/en/built-in-function-reference.html
MySQL 8.1: https://web.archive.org/web/20231001231110/https://dev.mysql.com/doc/refman/8.1/en/built-in-function-reference.html
MySQL 8.2: https://web.archive.org/web/20231204125724/https://dev.mysql.com/doc/refman/8.2/en/built-in-function-reference.html
MySQL 8.3: https://web.archive.org/web/20240522075210/https://dev.mysql.com/doc/refman/8.3/en/built-in-function-reference.html
MySQL 8.4: https://dev.mysql.com/doc/refman/8.4/en/built-in-function-reference.html

MariaDB

⚠️
About MariaDB, for versions that described differences with MySQL version I took all functions from the MySQL version source and used the "changelog-differences" to adapt the differences.
Once done, as there is no fixed list for each version, I did manual comparison using information on:

  1. MariaDB website, if available
  2. Archives of MariaDB website using the wayback machine, if available
  3. GitHub lookup in sources, minor version by minor version scooting for tags only otherwise.

MariaDB 10.0: https://mariadb.com/kb/en/function-and-operator-reference/
MariaDB 10.1: https://mariadb.com/kb/en/function-and-operator-reference/
MariaDB 10.2: https://mariadb.com/kb/en/function-differences-between-mariadb-102-and-mysql-56/
MariaDB 10.3: https://mariadb.com/kb/en/function-differences-between-mariadb-103-and-mysql-57/
MariaDB 10.4: https://mariadb.com/kb/en/function-differences-between-mariadb-10-4-and-mysql-8-0/
MariaDB 10.5: https://mariadb.com/kb/en/function-differences-between-mariadb-10-5-and-mysql-8-0/
MariaDB 10.6: https://mariadb.com/kb/en/function-differences-between-mariadb-10-6-and-mysql-8-0/
MariaDB 10.7: https://mariadb.com/kb/en/function-differences-between-mariadb-10-7-and-mysql-8-0/
MariaDB 10.8: https://mariadb.com/kb/en/function-differences-between-mariadb-10-8-and-mysql-8-0/
MariaDB 10.9: https://mariadb.com/kb/en/function-differences-between-mariadb-10-9-and-mysql-8-0/
MariaDB 10.10: https://mariadb.com/kb/en/function-differences-between-mariadb-10-10-and-mysql-8-0/
MariaDB 10.11: https://mariadb.com/kb/en/function-differences-between-mariadb-10-11-and-mysql-8-0/
MariaDB 11.0: https://mariadb.com/kb/en/function-differences-between-mariadb-11-0-and-mysql-8-0/
MariaDB 11.1: https://mariadb.com/kb/en/function-differences-between-mariadb-11-1-and-mysql-8-0/
MariaDB 11.2: https://mariadb.com/kb/en/function-differences-between-mariadb-11-2-and-mysql-8-0/
MariaDB 11.3: https://mariadb.com/kb/en/function-differences-between-mariadb-11-3-and-mysql-8-0/
MariaDB 11.4: https://mariadb.com/kb/en/function-differences-between-mariadb-11-4-and-mysql-8-0/

Annexes for specific MariaDB functions' origin:

BINLOG_GTID_POS: Since MariaDB 10.0.2 : https://web.archive.org/web/20150912134347/https://mariadb.com/kb/en/mariadb/binlog_gtid_pos/
(ST_)BOUNDARY: Since MariaDB 10.1.2 : https://web.archive.org/web/20150410200336/https://mariadb.com/kb/en/mariadb/st_boundary/
(ST_)BUFFER: Since MariaDB 10.0.x : GitHub sources
COLUMN_*: Since MariaDB 5.3 : https://web.archive.org/web/20150925234848/https://mariadb.com/kb/en/mariadb/column_add/
(ST_)ConvexHull: Since MariaDB 10.1.2 : https://web.archive.org/web/20150410205523/https://mariadb.com/kb/en/mariadb/st_convexhull/
CUME_DIST: Since MariaDB 10.2.0 : https://web.archive.org/web/20200808042303/https://mariadb.com/kb/en/cume_dist/
CURRENT_ROLE: Since MariaDB 10.0.x : GitHub sources
DECODE_HISTOGRAM: Since MariaDB 10.0.x : GitHub sources
DENSE_RANK: Since MariaDB 10.2 : https://web.archive.org/web/20200302220448/https://mariadb.com/kb/en/dense_rank/
FROM_BASE64: Since MariaDB 10.0.5 : https://web.archive.org/web/20201028152820/https://mariadb.com/kb/en/from_base64/
INET6_ATON: Since MariaDB 10.0.12 : https://web.archive.org/web/20200924180425/https://mariadb.com/kb/en/inet6_aton/
INET6_NTOA: Since MariaDB 10.0.12 : https://web.archive.org/web/20200924190209/https://mariadb.com/kb/en/inet6_ntoa/
IS_IPV4: Since MariaDB 10.0.12: https://web.archive.org/web/20201026185357/https://mariadb.com/kb/en/is_ipv4/
IS_IPV4_COMPAT: Since MariaDB 10.0.12: https://web.archive.org/web/20200924190655/https://mariadb.com/kb/en/is_ipv4_compat/
IS_IPV4_MAPPED: Since MariaDB 10.0.12: https://web.archive.org/web/20200924183127/https://mariadb.com/kb/en/is_ipv4_mapped/
IS_IPV6: Since MariaDB 10.0.12: https://web.archive.org/web/20200924175447/https://mariadb.com/kb/en/is_ipv6/
(ST_)IsRing : Since MariaDB 10.1.2 : https://web.archive.org/web/20150410122112/https://mariadb.com/kb/en/mariadb/st_isring/
LAST_DAY: Since MariaDB 10.0.0 : GitHub sources
LAST_VALUE: Since MariaDB 10.0.0 : GitHub sources
LASTVAL: Since MariaDB 10.3: https://web.archive.org/web/20200919120627/https://mariadb.com/kb/en/previous-value-for-sequence_name/
MASTER_GTID_WAIT: Since MariaDB 10.0.9: https://web.archive.org/web/20140313211749/https://mariadb.com/kb/en/master_gtid_wait/
MEDIAN: Since MariaDB 10.3.3: https://web.archive.org/web/20200919124023/https://mariadb.com/kb/en/median/
NATURAL_SORT_KEY: Since MariaDB 10.7.0: https://mariadb.com/kb/en/natural_sort_key/
NEXTVAL: Since MariaDB 10.3: https://web.archive.org/web/20201028143308/https://mariadb.com/kb/en/next-value-for-sequence_name/
(ST_)PointOnSurface: Since MariaDB 10.1.2: https://web.archive.org/web/20150410150220/https://mariadb.com/kb/en/mariadb/st_pointonsurface/
REGEXP_INSTR: Since MariaDB 10.0.5: https://web.archive.org/web/20150925001520/https://mariadb.com/kb/en/mariadb/regexp_instr/
REGEXP_REPLACE: Since MariaDB 10.0.5: https://web.archive.org/web/20170113004307/https://mariadb.com/kb/en/mariadb/regexp_replace/
REGEXP_SUBSTR: Since MariaDB 10.0.5: https://web.archive.org/web/20171123231315/https://mariadb.com/kb/en/library/regexp_substr/
SETVAL: Since MariaDB 10.3: https://web.archive.org/web/20201020032819/https://mariadb.com/kb/en/setval/
SYS_GUID: Since MariaDB 10.6.1: https://mariadb.com/kb/en/sys_guid/
TO_BASE64: Since MariaDB 10.0.5 : https://web.archive.org/web/20201022130615/https://mariadb.com/kb/en/to_base64/
TO_CHAR: Since MariaDB 10.6.1 : https://mariadb.com/kb/en/to_char/
WEIGHT_STRING: Since MariaDB 10.0.5 : https://web.archive.org/web/20200804235441/https://mariadb.com/kb/en/weight_string/

Tip

MySQL 8.4 has been also added to the list. 🥳

Thanks a lot 🙂

@niconoe- niconoe- changed the base branch from master to 5.9.x August 8, 2024 17:56
@MauricioFauth MauricioFauth changed the base branch from 5.9.x to 5.10.x August 25, 2024 17:25
@niconoe-
Copy link
Contributor Author

Now that #570 has been merged into 5.10.x, I'll rebase and do the same for MySQL 8.4.

@niconoe- niconoe- force-pushed the fix/add-missing-functions-in-dictionnaries branch from e0a86be to 957cc03 Compare August 26, 2024 09:53
@niconoe-
Copy link
Contributor Author

Here we go 😄

Just to enlight the 3 last commits :

  • Even if not being used as a function, the keyword "BINARY" is parsed by SQL-Parser as a function today, so I re-added it on every context to avoid BC Break.
  • Prior to MySQL 5.7, "PROCEDURE ANALYSE" was a function, but SQL-Parser already considered it as the function "ANALYSE" called in a "PROCEDURE" context. Therefore, there was no need to consider it as a function on its own, and I removed it from the impacted contexts.
  • There was a unit test where the keyword "RANK" was considered as an unknown token (Token 0, Flag 0) because of a missing definition in the dictionaries. As this is fixed, I also regenerated the expected tokens values for this test to consider "RANK" as expected.

All changes on the contexts are now free of BC Breaks and all tests are passing 👍

Ready for review @williamdes / @MauricioFauth 😉

@niconoe- niconoe- marked this pull request as ready for review August 26, 2024 11:00
Copy link
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like how this is easy to read 👏🏻

Copy link
Member

@MauricioFauth MauricioFauth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@niconoe-
Copy link
Contributor Author

I just discovered few minutes ago that MySQL 9.0 has been released 😭

Don't consider MySQL 9.0 yet, I'll probably add the dictionnary in an incoming PR.

@liviuconcioiu
Copy link
Contributor

I just discovered few minutes ago that MySQL 9.0 has been released 😭

Don't consider MySQL 9.0 yet, I'll probably add the dictionnary in an incoming PR.

Even MariaDB 11.5 :)

@MauricioFauth MauricioFauth merged commit a4bdc3a into phpmyadmin:5.10.x Aug 26, 2024
19 checks passed
@MauricioFauth MauricioFauth self-assigned this Aug 26, 2024
@MauricioFauth MauricioFauth added this to the 5.10.0 milestone Aug 26, 2024
@niconoe- niconoe- deleted the fix/add-missing-functions-in-dictionnaries branch August 26, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants