Comments - String Literals

1 year, 8 months ago Tibor den Ouden

Is it possible to emit a warning when string literals are concatenated ? May be only when a specific option is set. The reason is that I got bitten by literal string concatenation in the following case: I have a given datamodel which contains enums in several records. Then there is code which based on the value of the enum field does certain processing. The code structure is typically like: if foo_bar in ('enum0', 'enum1', ...) then

If you forget to type the , then you get a different value to which foo_bar is never equal and you initially do not understand what is going on. A warning when the script is processed about literal concatenation would trigger some extra inspection.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.