polardbxengine/mysql-test/suite/sysschema/t/fn_format_statement.test

13 lines
659 B
Plaintext

# Tests for sys schema
# Verify the sys.format_statement() function perfoms as expected
# Passing NULL should return NULL
SELECT sys.format_statement(NULL);
# Ensure long statements are truncated correctly
SELECT sys.format_statement('SELECT foo, bar, baz, foobar, foobaz FROM foo JOIN bar USING (foobar) JOIN baz USING (foobar) WHERE foo = \'foo\' AND bar = \'bar\'') AS statement;
# Increase truncation limit and test that it takes effect
SET @sys.statement_truncate_len = 80;
SELECT sys.format_statement('SELECT foo, bar, baz, foobar, foobaz FROM foo JOIN bar USING (foobar) JOIN baz USING (foobar) WHERE foo = \'foo\' AND bar = \'bar\'') AS statement;