7.3.3 The SQL Editor Tab

This section provides configuration options that affect the SQL Editor functionality in MySQL Workbench.

Note

There is also an SQL Editor section in the General preference tab, with preference settings for how the SQL Editor tabs are saved, and opened.

The SQL Editor is divided into three sections: General, Productivity, and SQL Parsing in Text Editors, as seen in the following screenshot:

Figure 7.5 The SQL Editor Preferences

The SQL Editor preferences

General

Productivity

The query results properties that can be set include the following:

SQL

SQL properties that can be set include the SQL_MODE, case sensitivity of identifiers, and the SQL delimiter used.

The document property SqlMode defines SQL_MODE for all operations affecting SQL parsing at the document scope. The purpose of this option is to preserve the consistency of SQL statements within the document.

The property has the following functions:

Only a subset of all possible SQL_MODE values affect the MySQL Workbench SQL parser. These values are: ANSI_QUOTES, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_BACKSLASH_ESCAPES, PIPES_AS_CONCAT. Other values do not affect the MySQL Workbench SQL parser and are ignored.

If the value of SqlMode is not set, the default value of the SQL_MODE session variable defined by the server stays unchanged during operations with the server. However, the MySQL Workbench SQL parser behaves as if SQL_MODE is also not set. This may potentially lead to inconsistencies in parsing of SQL statements stored in the document. If you choose to not set the SqlMode property, ensure that the default SQL_MODE variable defined by the server does not contain any values from the following list: ANSI_QUOTES, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_BACKSLASH_ESCAPES, PIPES_AS_CONCAT.

The SqlMode property is defined in two locations: globally and at document scope. MySQL Workbench uses the global property to initialize the document property for each new document created. For each document, the property value defined at document scope always has higher priority over the one defined globally.