Skip to content

MySQL support (queries) #5

Open
@nene

Description

@nene

Data types

Basic syntax

  • comment syntax differences
  • identifier syntax
    • unicode letters: ähhää
    • dollar sign as non-first character foo$bar
    • dollar sign as first character $foo (though it generates a warning)
    • can begin with a number
  • String literals
  • Interval literals
  • Number literals
  • Date/Time literals
  • Hex literals: x'01af' syntax
  • Hex literals: 0x01AF syntax
  • Bit literals: b'01' syntax
  • Bit literals: 0b01 syntax
  • Variables (using @name syntax)
  • ODBC syntax for date/time literals (e.g. { d 'str' })
  • Executable comments (like /*! STRAIGHT_JOIN */)

Expressions

  • Operators:
    • Concatenation of strings with space
      • 'foo' 'bar
      • 'foo' "bar"
      • N'foo' 'bar'
      • _utf8 'foo' 'bar'
    • &&, || as equivalent to AND, OR
    • IS [NOT] {TRUE | FALSE}
    • IS [NOT] UNKNOWN
    • >= ANY | SOME | ALL
    • <=>
    • !
    • SOUNDS LIKE
    • COLLATE
    • BINARY
    • MEMBER OF
    • JSON operators
    • := assignment operator
    • Full text search
    • Precedence rules
  • ROW ( ... ) expressions
  • Function calls:
    • Built-in function name parsing
    • parenthesis-less function calls: CURRENT_DATE, CURRENT_TIMESTAMP, CURRENT_TIME, CURRENT_USER, LOCALTIME, LOCALTIMESTAMP.
    • EXTRACT(... FROM ...)

Parameters

  • ? syntax.

Query syntax

  • Hints: HIGH_PRIORITY, STRAIGHT_JOIN, SQL_SMALL_RESULT ...
  • Use of hints both before and after DISTINCT, like: SELECT STRAIGHT_JOIN DISTINCT HIGH_PRIORITY
  • DISTINCTROW
  • INTO {OUTFILE | DUMPFILE | var}
  • GROUP BY ... WITH ROLLUP
  • ORDER BY ... WITH ROLLUP
  • FOR {UPDATE | SHARE} clause
  • LOCK IN SHARE MODE
  • FROM clause:
    • PARTITION selection
    • FROM DUAL
    • LATERAL
    • STRAIGHT_JOIN
    • List of tables inside parens tbl LEFT JOIN (tbl1, tbl2, tbl3) ON tbl.id=tbl1.id AND tbl1.id=tbl2.id
    • Table alias with column list
    • index hint list:
      • {USE | IGNORE | FORCE} {INDEX | KEY}
      • [ FOR {JOIN | ORDER BY | GROUP BY} ]
      • ([index_name, ...])
    • ODBC { OJ ... } syntax
  • TABLE statements (shorthand for simple SELECT)
  • VALUES statements

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions