3 * Column types and functions supported by MySQL
8 // VARCHAR, TINYINT, TEXT and DATE are listed first, based on estimated popularity
9 $cfg['ColumnTypes'] = !empty($cfg['ColumnTypes']) ?
$cfg['ColumnTypes'] : array(
36 'DATE and TIME' => array(
78 $cfg['AttributeTypes'] = !empty($cfg['AttributeTypes']) ?
$cfg['AttributeTypes'] : array(
83 'on update CURRENT_TIMESTAMP',
86 if ($cfg['ShowFunctionFields']) {
87 $cfg['RestrictColumnTypes'] = !empty($cfg['RestrictColumnTypes']) ?
$cfg['RestrictColumnTypes'] : array(
88 'TINYINT' => 'FUNC_NUMBER',
89 'SMALLINT' => 'FUNC_NUMBER',
90 'MEDIUMINT' => 'FUNC_NUMBER',
91 'INT' => 'FUNC_NUMBER',
92 'BIGINT' => 'FUNC_NUMBER',
93 'DECIMAL' => 'FUNC_NUMBER',
94 'FLOAT' => 'FUNC_NUMBER',
95 'DOUBLE' => 'FUNC_NUMBER',
96 'REAL' => 'FUNC_NUMBER',
97 'BIT' => 'FUNC_NUMBER',
98 'BOOLEAN' => 'FUNC_NUMBER',
99 'SERIAL' => 'FUNC_NUMBER',
101 'DATE' => 'FUNC_DATE',
102 'DATETIME' => 'FUNC_DATE',
103 'TIMESTAMP' => 'FUNC_DATE',
104 'TIME' => 'FUNC_DATE',
105 'YEAR' => 'FUNC_DATE',
107 'CHAR' => 'FUNC_CHAR',
108 'VARCHAR' => 'FUNC_CHAR',
109 'TINYTEXT' => 'FUNC_CHAR',
110 'TEXT' => 'FUNC_CHAR',
111 'MEDIUMTEXT' => 'FUNC_CHAR',
112 'LONGTEXT' => 'FUNC_CHAR',
113 'BINARY' => 'FUNC_CHAR',
114 'VARBINARY' => 'FUNC_CHAR',
115 'TINYBLOB' => 'FUNC_CHAR',
116 'MEDIUMBLOB' => 'FUNC_CHAR',
117 'BLOB' => 'FUNC_CHAR',
118 'LONGBLOB' => 'FUNC_CHAR',
122 'GEOMETRY' => 'FUNC_SPATIAL',
123 'POINT' => 'FUNC_SPATIAL',
124 'LINESTRING' => 'FUNC_SPATIAL',
125 'POLYGON' => 'FUNC_SPATIAL',
126 'MULTIPOINT' => 'FUNC_SPATIAL',
127 'MULTILINESTRING' => 'FUNC_SPATIAL',
128 'MULTIPOLYGON' => 'FUNC_SPATIAL',
129 'GEOMETRYCOLLECTION' => 'FUNC_SPATIAL',
133 $restrict_functions = array(
134 'FUNC_CHAR' => array(
168 'FUNC_DATE' => array(
186 'FUNC_NUMBER' => array(
231 'UNCOMPRESSED_LENGTH',
240 'FUNC_SPATIAL' => array(
261 // $restrict_functions holds all known functions, remove these that are unavailable on current server
262 if (PMA_MYSQL_INT_VERSION
< 50500) {
263 $restrict_functions['FUNC_NUMBER'] = array_diff($restrict_functions['FUNC_NUMBER'], array('TO_SECONDS'));
265 if (PMA_MYSQL_INT_VERSION
< 50120) {
266 $restrict_functions['FUNC_NUMBER'] = array_diff($restrict_functions['FUNC_NUMBER'], array('UUID_SHORT'));
269 if (empty($cfg['RestrictFunctions'])) {
270 $cfg['RestrictFunctions'] = $restrict_functions;
273 if (empty($cfg['Functions'])) {
274 // build a list of functions based on $restrict_functions
275 $cfg['Functions'] = array();
276 foreach ($restrict_functions as $cat => $functions) {
277 if ($cat != 'FUNC_SPATIAL') {
278 $cfg['Functions'] = array_merge($cfg['Functions'], $functions);
281 sort($cfg['Functions']);
283 unset($restrict_functions);