This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/examplefiles/text/mysql.txt.output
Oleh Prypin 6f43092173
Also add auto-updatable output-based tests to examplefiles (#1689)
Co-authored-by: Georg Brandl <georg@python.org>
2021-01-20 10:48:45 +01:00

1 line
2.6 KiB
Text
Generated

'-- Samples of MySQL parsing\n\n\n-- Comments\n# standalone comment line\n-- standalone comment line\nSELECT 1; -- trailing comment\nSELECT 1; # trailing comment\nSELECT 1; /* trailing comment */\nSELECT /* interruption */ /**/ 1;\n /*\n Multiline / * / comment\n */\n /* /* MySQL does not support nested comments */\nSELECT \'If this line is a comment then nested commenting is enabled (and therefore broken).\';\n\n\n-- Optimizer hints\nSELECT /*+ SEMIJOIN(FIRSTMATCH, LOOSESCAN) */ 1;\nSELECT /*+ SET_VAR(foreign_key_checks=OFF) */ 1;\n\n\n-- Literals\nSELECT\n -- Integers\n 123,\n\n -- Floats\n .123, 1.23, 123.,\n\n -- Exponents\n 1e10, 1e-10, 1.e20, .1e-20,\n\n -- Hexadecimal\n X\'0af019\', x\'0AF019\', 0xaf019,\n\n -- Binary\n B\'010\', b\'010\', 0b010,\n\n -- Temporal literals\n {d\'2020-01-01\'}, { d \' 2020^01@01 \' },\n {t\'8 9:10:11\'}, { t \' 09:10:11.12 \' }, { t \' 091011 \' },\n {ts"2020-01-01 09:10:11"}, { ts \' 2020@01/01 09:10:11 \' },\n\n -- Strings\n \'\', \'abc\', \'1\'\'2\\03\\%4\\_5\\\\6\\\'7\\"8\',\n "", "abc", "1""2\\03\\%4\\_5\\\\6\\\'7\\"8",\n;\n\n\n-- Variables\nSET @a = 1, @1 = 2, @._.$ = 3;\nSET @\'?\' = 1, @\'abc\'\'def"`ghi\' = 2;\nSET @"#" = 1, @"abc""def\'`ghi" = 2;\nSET @`^` = 1, @`abc``def\'"ghi` = 2;\nSELECT\n @@timestamp,\n @@global.auto_increment_offset,\n @@session.auto_increment_offset,\n @@auto_increment_offset\n;\n\n\n-- Prepared statements\nSELECT POW(?, 3) AS cubed;\n\n\n-- Constants\nSELECT TRUE, FALSE, NULL, UNKNOWN;\n\n\n-- Data types\nCREATE TABLE table1 (\n id INT AUTO_INCREMENT PRIMARY KEY,\n name VARCHAR(20) NOT NULL,\n birthyear YEAR\n);\n\n\n-- Keywords\nINSERT INTO table1 (person, birthyear) VALUES (\'abc\', 2020);\n\nWITH RECURSIVE example (n) AS (\n SELECT 1\n UNION ALL\n SELECT n + 1 FROM example\n WHERE n < 10\n)\nSELECT n FROM example;\n\nSELECT 17 MEMBER OF (\'[23, "abc", 17, "ab", 10]\');\n\n\n-- Functions\nSELECT CONCAT(\'function\');\nSELECT MAX(quantity) FROM example;\n\n\n-- Schema object names\nCREATE TABLE basic (\n example INT,\n 股票编号 INT,\n `select` INT,\n `concat(` INT\n);\n\nSELECT e1.`apple` AS a, `example2`.b\nFROM example1 AS e1\nJOIN example2 e2\nON `example1`.`a``b` = e2.`123`;\n\n\n-- Operators\nSELECT 1 + 2 - 3 << 2;\nSELECT 1::DECIMAL(5, 2);\nSET @a = 1;\nSET a := 1;\nSELECT c->>\'$.name\' FROM example;\n\n\n\n-- Exceptions\nCREATE TABLE t1\n(\n c1 VARCHAR(5) CHARACTER SET latin1,\n c2 SET(\'r\', \'g\', \'b\')\n);\n\n\n-- Introducers\nSELECT _latin1\'abc\';\nSELECT _binary\'abc\';\n' Text