Chapter 12 Functions and Operators Table of Contents 2093 12.1 Built-In Function and Operator Reference .............................................................................. 2095 12.2 Loadable Function Reference ................................................................................................ 2116 12.3 Type Conversion in Expression Evaluation ............................................................................. 2119 12.4 Operators ............................................................................................................................. 2122 12.4.1 Operator Precedence ................................................................................................. 2124 12.4.2 Comparison Functions and Operators ......................................................................... 2125 12.4.3 Logical Operators ....................................................................................................... 2131 12.4.4 Assignment Operators ................................................................................................ 2133 12.5 Flow Control Functions .......................................................................................................... 2134 12.6 Numeric Functions and Operators .......................................................................................... 2137 12.6.1 Arithmetic Operators ................................................................................................... 2138 12.6.2 Mathematical Functions .............................................................................................. 2140 12.7 Date and Time Functions ...................................................................................................... 2150 12.8 String Functions and Operators ............................................................................................. 2171 12.8.1 String Comparison Functions and Operators ................................................................ 2186 12.8.2 Regular Expressions .................................................................................................. 2190 12.8.3 Character Set and Collation of Function Results .......................................................... 2200 12.9 What Calendar Is Used By MySQL? ...................................................................................... 2202 12.10 Full-Text Search Functions .................................................................................................. 2202 12.10.1 Natural Language Full-Text Searches ........................................................................ 2203 12.10.2 Boolean Full-Text Searches ...................................................................................... 2207 12.10.3 Full-Text Searches with Query Expansion .................................................................. 2212 12.10.4 Full-Text Stopwords .................................................................................................. 2213 12.10.5 Full-Text Restrictions ................................................................................................ 2218 12.10.6 Fine-Tuning MySQL Full-Text Search ........................................................................ 2218 12.10.7 Adding a User-Defined Collation for Full-Text Indexing ............................................... 2221 12.10.8 ngram Full-Text Parser ............................................................................................. 2223 12.10.9 MeCab Full-Text Parser Plugin ................................................................................. 2226 12.11 Cast Functions and Operators ............................................................................................. 2230 12.12 XML Functions .................................................................................................................... 2247 12.13 Bit Functions and Operators ................................................................................................ 2258 12.14 Encryption and Compression Functions ................................................................................ 2271 12.15 Locking Functions ............................................................................................................... 2277 12.16 Information Functions .......................................................................................................... 2279 12.17 Spatial Analysis Functions ................................................................................................... 2290 12.17.1 Spatial Function Reference ....................................................................................... 2291 12.17.2 Argument Handling by Spatial Functions ................................................................... 2295 12.17.3 Functions That Create Geometry Values from WKT Values ........................................ 2295 12.17.4 Functions That Create Geometry Values from WKB Values ........................................ 2298 12.17.5 MySQL-Specific Functions That Create Geometry Values ........................................... 2299 12.17.6 Geometry Format Conversion Functions .................................................................... 2301 12.17.7 Geometry Property Functions .................................................................................... 2303 12.17.8 Spatial Operator Functions ........................................................................................ 2317 12.17.9 Functions That Test Spatial Relations Between Geometry Objects .............................. 2325 12.17.10 Spatial Geohash Functions ..................................................................................... 2333 12.17.11 Spatial GeoJSON Functions .................................................................................... 2335 12.17.12 Spatial Aggregate Functions ................................................................................... 2337 12.17.13 Spatial Convenience Functions ............................................................................... 2339