diff options
author | unknown <serg@janus.mylan> | 2007-04-13 19:23:02 +0200 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2007-04-13 19:23:02 +0200 |
commit | bf2aaad97d0ff65a4a79f9012b4443d4d6dbd6e8 (patch) | |
tree | c318326d7c94a04b34753308fce3a0bb1b38f53e /sql | |
parent | 1e6bd48ccbd725c298453cf6c7645b430529fe43 (diff) | |
download | mariadb-git-bf2aaad97d0ff65a4a79f9012b4443d4d6dbd6e8.tar.gz |
wl#2936 - fixing problems
include/mysql/plugin.h:
warning. no int/realsize
mysys/my_getopt.c:
combination of prefixes (e.g. --loose-skip-) didn't work
sql/event_queue.cc:
warning
sql/handler.cc:
assert
sql/handler.h:
comment
sql/item_create.cc:
warnings
sql/log.cc:
warnings
sql/mysqld.cc:
wl#2936 - fixing problems (memory leak in load_defaults,
garbage in opt_[slow_]logname
sql/partition_element.h:
warnings
sql/rpl_utility.h:
warnings
sql/set_var.cc:
comment
sql/set_var.h:
warnings
sql/sql_class.cc:
warnings
sql/sql_parse.cc:
warnings
sql/sql_plugin.cc:
wl#2936 - fixing problems: portability, coding style,
reporting of spurious errors, crashes, incorrect help output
storage/example/ha_example.cc:
comment
storage/innobase/handler/ha_innodb.cc:
wl#2936 - fixing problems (crash)
Diffstat (limited to 'sql')
-rw-r--r-- | sql/event_queue.cc | 2 | ||||
-rw-r--r-- | sql/handler.cc | 1 | ||||
-rw-r--r-- | sql/handler.h | 4 | ||||
-rw-r--r-- | sql/item_create.cc | 382 | ||||
-rw-r--r-- | sql/log.cc | 4 | ||||
-rw-r--r-- | sql/mysqld.cc | 35 | ||||
-rw-r--r-- | sql/partition_element.h | 4 | ||||
-rw-r--r-- | sql/rpl_utility.h | 2 | ||||
-rw-r--r-- | sql/set_var.cc | 2 | ||||
-rw-r--r-- | sql/set_var.h | 6 | ||||
-rw-r--r-- | sql/sql_class.cc | 16 | ||||
-rw-r--r-- | sql/sql_parse.cc | 62 | ||||
-rw-r--r-- | sql/sql_plugin.cc | 159 |
13 files changed, 338 insertions, 341 deletions
diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 068abbe3408..38ba212bef3 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -79,7 +79,7 @@ event_queue_element_compare_q(void *vptr, byte* a, byte *b) */ Event_queue::Event_queue() - :mutex_last_unlocked_at_line(0), mutex_last_locked_at_line(0), + :mutex_last_locked_at_line(0), mutex_last_unlocked_at_line(0), mutex_last_attempted_lock_at_line(0), mutex_queue_data_locked(FALSE), mutex_queue_data_attempting_lock(FALSE) { diff --git a/sql/handler.cc b/sql/handler.cc index f548dc32b7e..b4fc7db3809 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1508,6 +1508,7 @@ void **handler::ha_data(void) const THD *handler::ha_thd(void) const { + DBUG_ASSERT(!table || !table->in_use || table->in_use == current_thd); return (table && table->in_use) ? table->in_use : current_thd; } diff --git a/sql/handler.h b/sql/handler.h index fbdd48fcc6d..076fffe142e 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1516,6 +1516,10 @@ public: /* lock_count() can be more than one if the table is a MERGE */ virtual uint lock_count(void) const { return 1; } + /* + NOTE that one can NOT rely on table->in_use in store_lock(). It may + refer to a different thread if called from mysql_lock_abort_for_thread(). + */ virtual THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type)=0; diff --git a/sql/item_create.cc b/sql/item_create.cc index ff5825ef389..f4990a8abdf 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -4684,197 +4684,197 @@ struct Native_func_registry static Native_func_registry func_array[] = { - { C_STRING_WITH_LEN("ABS"), BUILDER(Create_func_abs)}, - { C_STRING_WITH_LEN("ACOS"), BUILDER(Create_func_acos)}, - { C_STRING_WITH_LEN("ADDTIME"), BUILDER(Create_func_addtime)}, - { C_STRING_WITH_LEN("AES_DECRYPT"), BUILDER(Create_func_aes_decrypt)}, - { C_STRING_WITH_LEN("AES_ENCRYPT"), BUILDER(Create_func_aes_encrypt)}, - { C_STRING_WITH_LEN("AREA"), GEOM_BUILDER(Create_func_area)}, - { C_STRING_WITH_LEN("ASBINARY"), GEOM_BUILDER(Create_func_as_wkb)}, - { C_STRING_WITH_LEN("ASIN"), BUILDER(Create_func_asin)}, - { C_STRING_WITH_LEN("ASTEXT"), GEOM_BUILDER(Create_func_as_wkt)}, - { C_STRING_WITH_LEN("ASWKB"), GEOM_BUILDER(Create_func_as_wkb)}, - { C_STRING_WITH_LEN("ASWKT"), GEOM_BUILDER(Create_func_as_wkt)}, - { C_STRING_WITH_LEN("ATAN"), BUILDER(Create_func_atan)}, - { C_STRING_WITH_LEN("ATAN2"), BUILDER(Create_func_atan)}, - { C_STRING_WITH_LEN("BENCHMARK"), BUILDER(Create_func_benchmark)}, - { C_STRING_WITH_LEN("BIN"), BUILDER(Create_func_bin)}, - { C_STRING_WITH_LEN("BIT_COUNT"), BUILDER(Create_func_bit_count)}, - { C_STRING_WITH_LEN("BIT_LENGTH"), BUILDER(Create_func_bit_length)}, - { C_STRING_WITH_LEN("CEIL"), BUILDER(Create_func_ceiling)}, - { C_STRING_WITH_LEN("CEILING"), BUILDER(Create_func_ceiling)}, - { C_STRING_WITH_LEN("CENTROID"), GEOM_BUILDER(Create_func_centroid)}, - { C_STRING_WITH_LEN("CHARACTER_LENGTH"), BUILDER(Create_func_char_length)}, - { C_STRING_WITH_LEN("CHAR_LENGTH"), BUILDER(Create_func_char_length)}, - { C_STRING_WITH_LEN("COERCIBILITY"), BUILDER(Create_func_coercibility)}, - { C_STRING_WITH_LEN("COMPRESS"), BUILDER(Create_func_compress)}, - { C_STRING_WITH_LEN("CONCAT"), BUILDER(Create_func_concat)}, - { C_STRING_WITH_LEN("CONCAT_WS"), BUILDER(Create_func_concat_ws)}, - { C_STRING_WITH_LEN("CONNECTION_ID"), BUILDER(Create_func_connection_id)}, - { C_STRING_WITH_LEN("CONV"), BUILDER(Create_func_conv)}, - { C_STRING_WITH_LEN("CONVERT_TZ"), BUILDER(Create_func_convert_tz)}, - { C_STRING_WITH_LEN("COS"), BUILDER(Create_func_cos)}, - { C_STRING_WITH_LEN("COT"), BUILDER(Create_func_cot)}, - { C_STRING_WITH_LEN("CRC32"), BUILDER(Create_func_crc32)}, - { C_STRING_WITH_LEN("CROSSES"), GEOM_BUILDER(Create_func_crosses)}, - { C_STRING_WITH_LEN("DATEDIFF"), BUILDER(Create_func_datediff)}, - { C_STRING_WITH_LEN("DATE_FORMAT"), BUILDER(Create_func_date_format)}, - { C_STRING_WITH_LEN("DAYNAME"), BUILDER(Create_func_dayname)}, - { C_STRING_WITH_LEN("DAYOFMONTH"), BUILDER(Create_func_dayofmonth)}, - { C_STRING_WITH_LEN("DAYOFWEEK"), BUILDER(Create_func_dayofweek)}, - { C_STRING_WITH_LEN("DAYOFYEAR"), BUILDER(Create_func_dayofyear)}, - { C_STRING_WITH_LEN("DECODE"), BUILDER(Create_func_decode)}, - { C_STRING_WITH_LEN("DEGREES"), BUILDER(Create_func_degrees)}, - { C_STRING_WITH_LEN("DES_DECRYPT"), BUILDER(Create_func_des_decrypt)}, - { C_STRING_WITH_LEN("DES_ENCRYPT"), BUILDER(Create_func_des_encrypt)}, - { C_STRING_WITH_LEN("DIMENSION"), GEOM_BUILDER(Create_func_dimension)}, - { C_STRING_WITH_LEN("DISJOINT"), GEOM_BUILDER(Create_func_disjoint)}, - { C_STRING_WITH_LEN("ELT"), BUILDER(Create_func_elt)}, - { C_STRING_WITH_LEN("ENCODE"), BUILDER(Create_func_encode)}, - { C_STRING_WITH_LEN("ENCRYPT"), BUILDER(Create_func_encrypt)}, - { C_STRING_WITH_LEN("ENDPOINT"), GEOM_BUILDER(Create_func_endpoint)}, - { C_STRING_WITH_LEN("ENVELOPE"), GEOM_BUILDER(Create_func_envelope)}, - { C_STRING_WITH_LEN("EQUALS"), GEOM_BUILDER(Create_func_equals)}, - { C_STRING_WITH_LEN("EXP"), BUILDER(Create_func_exp)}, - { C_STRING_WITH_LEN("EXPORT_SET"), BUILDER(Create_func_export_set)}, - { C_STRING_WITH_LEN("EXTERIORRING"), GEOM_BUILDER(Create_func_exteriorring)}, - { C_STRING_WITH_LEN("EXTRACTVALUE"), BUILDER(Create_func_xml_extractvalue)}, - { C_STRING_WITH_LEN("FIELD"), BUILDER(Create_func_field)}, - { C_STRING_WITH_LEN("FIND_IN_SET"), BUILDER(Create_func_find_in_set)}, - { C_STRING_WITH_LEN("FLOOR"), BUILDER(Create_func_floor)}, - { C_STRING_WITH_LEN("FORMAT"), BUILDER(Create_func_format)}, - { C_STRING_WITH_LEN("FOUND_ROWS"), BUILDER(Create_func_found_rows)}, - { C_STRING_WITH_LEN("FROM_DAYS"), BUILDER(Create_func_from_days)}, - { C_STRING_WITH_LEN("FROM_UNIXTIME"), BUILDER(Create_func_from_unixtime)}, - { C_STRING_WITH_LEN("GEOMCOLLFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("GEOMCOLLFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("GEOMETRYFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("GEOMETRYFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("GEOMETRYN"), GEOM_BUILDER(Create_func_geometryn)}, - { C_STRING_WITH_LEN("GEOMETRYTYPE"), GEOM_BUILDER(Create_func_geometry_type)}, - { C_STRING_WITH_LEN("GEOMFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("GEOMFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("GET_LOCK"), BUILDER(Create_func_get_lock)}, - { C_STRING_WITH_LEN("GLENGTH"), GEOM_BUILDER(Create_func_glength)}, - { C_STRING_WITH_LEN("GREATEST"), BUILDER(Create_func_greatest)}, - { C_STRING_WITH_LEN("HEX"), BUILDER(Create_func_hex)}, - { C_STRING_WITH_LEN("IFNULL"), BUILDER(Create_func_ifnull)}, - { C_STRING_WITH_LEN("INET_ATON"), BUILDER(Create_func_inet_aton)}, - { C_STRING_WITH_LEN("INET_NTOA"), BUILDER(Create_func_inet_ntoa)}, - { C_STRING_WITH_LEN("INSTR"), BUILDER(Create_func_instr)}, - { C_STRING_WITH_LEN("INTERIORRINGN"), GEOM_BUILDER(Create_func_interiorringn)}, - { C_STRING_WITH_LEN("INTERSECTS"), GEOM_BUILDER(Create_func_intersects)}, - { C_STRING_WITH_LEN("ISCLOSED"), GEOM_BUILDER(Create_func_isclosed)}, - { C_STRING_WITH_LEN("ISEMPTY"), GEOM_BUILDER(Create_func_isempty)}, - { C_STRING_WITH_LEN("ISNULL"), BUILDER(Create_func_isnull)}, - { C_STRING_WITH_LEN("ISSIMPLE"), GEOM_BUILDER(Create_func_issimple)}, - { C_STRING_WITH_LEN("IS_FREE_LOCK"), BUILDER(Create_func_is_free_lock)}, - { C_STRING_WITH_LEN("IS_USED_LOCK"), BUILDER(Create_func_is_used_lock)}, - { C_STRING_WITH_LEN("LAST_DAY"), BUILDER(Create_func_last_day)}, - { C_STRING_WITH_LEN("LAST_INSERT_ID"), BUILDER(Create_func_last_insert_id)}, - { C_STRING_WITH_LEN("LCASE"), BUILDER(Create_func_lcase)}, - { C_STRING_WITH_LEN("LEAST"), BUILDER(Create_func_least)}, - { C_STRING_WITH_LEN("LENGTH"), BUILDER(Create_func_length)}, - { C_STRING_WITH_LEN("LINEFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("LINEFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("LINESTRINGFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("LINESTRINGFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("LN"), BUILDER(Create_func_ln)}, - { C_STRING_WITH_LEN("LOAD_FILE"), BUILDER(Create_func_load_file)}, - { C_STRING_WITH_LEN("LOCATE"), BUILDER(Create_func_locate)}, - { C_STRING_WITH_LEN("LOG"), BUILDER(Create_func_log)}, - { C_STRING_WITH_LEN("LOG10"), BUILDER(Create_func_log10)}, - { C_STRING_WITH_LEN("LOG2"), BUILDER(Create_func_log2)}, - { C_STRING_WITH_LEN("LOWER"), BUILDER(Create_func_lcase)}, - { C_STRING_WITH_LEN("LPAD"), BUILDER(Create_func_lpad)}, - { C_STRING_WITH_LEN("LTRIM"), BUILDER(Create_func_ltrim)}, - { C_STRING_WITH_LEN("MAKEDATE"), BUILDER(Create_func_makedate)}, - { C_STRING_WITH_LEN("MAKETIME"), BUILDER(Create_func_maketime)}, - { C_STRING_WITH_LEN("MAKE_SET"), BUILDER(Create_func_make_set)}, - { C_STRING_WITH_LEN("MASTER_POS_WAIT"), BUILDER(Create_func_master_pos_wait)}, - { C_STRING_WITH_LEN("MBRCONTAINS"), GEOM_BUILDER(Create_func_contains)}, - { C_STRING_WITH_LEN("MD5"), BUILDER(Create_func_md5)}, - { C_STRING_WITH_LEN("MLINEFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("MLINEFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("MONTHNAME"), BUILDER(Create_func_monthname)}, - { C_STRING_WITH_LEN("MPOINTFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("MPOINTFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("MPOLYFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("MPOLYFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("MULTILINESTRINGFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("MULTILINESTRINGFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("MULTIPOINTFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("MULTIPOINTFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("MULTIPOLYGONFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("MULTIPOLYGONFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("NAME_CONST"), BUILDER(Create_func_name_const)}, - { C_STRING_WITH_LEN("NULLIF"), BUILDER(Create_func_nullif)}, - { C_STRING_WITH_LEN("NUMGEOMETRIES"), GEOM_BUILDER(Create_func_numgeometries)}, - { C_STRING_WITH_LEN("NUMINTERIORRINGS"), GEOM_BUILDER(Create_func_numinteriorring)}, - { C_STRING_WITH_LEN("NUMPOINTS"), GEOM_BUILDER(Create_func_numpoints)}, - { C_STRING_WITH_LEN("OCT"), BUILDER(Create_func_oct)}, - { C_STRING_WITH_LEN("OCTET_LENGTH"), BUILDER(Create_func_length)}, - { C_STRING_WITH_LEN("ORD"), BUILDER(Create_func_ord)}, - { C_STRING_WITH_LEN("OVERLAPS"), GEOM_BUILDER(Create_func_overlaps)}, - { C_STRING_WITH_LEN("PERIOD_ADD"), BUILDER(Create_func_period_add)}, - { C_STRING_WITH_LEN("PERIOD_DIFF"), BUILDER(Create_func_period_diff)}, - { C_STRING_WITH_LEN("PI"), BUILDER(Create_func_pi)}, - { C_STRING_WITH_LEN("POINTFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("POINTFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("POINTN"), GEOM_BUILDER(Create_func_pointn)}, - { C_STRING_WITH_LEN("POLYFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("POLYFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("POLYGONFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, - { C_STRING_WITH_LEN("POLYGONFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, - { C_STRING_WITH_LEN("POW"), BUILDER(Create_func_pow)}, - { C_STRING_WITH_LEN("POWER"), BUILDER(Create_func_pow)}, - { C_STRING_WITH_LEN("QUOTE"), BUILDER(Create_func_quote)}, - { C_STRING_WITH_LEN("RADIANS"), BUILDER(Create_func_radians)}, - { C_STRING_WITH_LEN("RAND"), BUILDER(Create_func_rand)}, - { C_STRING_WITH_LEN("RELEASE_LOCK"), BUILDER(Create_func_release_lock)}, - { C_STRING_WITH_LEN("REVERSE"), BUILDER(Create_func_reverse)}, - { C_STRING_WITH_LEN("ROUND"), BUILDER(Create_func_round)}, - { C_STRING_WITH_LEN("ROW_COUNT"), BUILDER(Create_func_row_count)}, - { C_STRING_WITH_LEN("RPAD"), BUILDER(Create_func_rpad)}, - { C_STRING_WITH_LEN("RTRIM"), BUILDER(Create_func_rtrim)}, - { C_STRING_WITH_LEN("SEC_TO_TIME"), BUILDER(Create_func_sec_to_time)}, - { C_STRING_WITH_LEN("SHA"), BUILDER(Create_func_sha)}, - { C_STRING_WITH_LEN("SHA1"), BUILDER(Create_func_sha)}, - { C_STRING_WITH_LEN("SIGN"), BUILDER(Create_func_sign)}, - { C_STRING_WITH_LEN("SIN"), BUILDER(Create_func_sin)}, - { C_STRING_WITH_LEN("SLEEP"), BUILDER(Create_func_sleep)}, - { C_STRING_WITH_LEN("SOUNDEX"), BUILDER(Create_func_soundex)}, - { C_STRING_WITH_LEN("SPACE"), BUILDER(Create_func_space)}, - { C_STRING_WITH_LEN("SQRT"), BUILDER(Create_func_sqrt)}, - { C_STRING_WITH_LEN("SRID"), GEOM_BUILDER(Create_func_srid)}, - { C_STRING_WITH_LEN("STARTPOINT"), GEOM_BUILDER(Create_func_startpoint)}, - { C_STRING_WITH_LEN("STRCMP"), BUILDER(Create_func_strcmp)}, - { C_STRING_WITH_LEN("STR_TO_DATE"), BUILDER(Create_func_str_to_date)}, - { C_STRING_WITH_LEN("SUBSTRING_INDEX"), BUILDER(Create_func_substr_index)}, - { C_STRING_WITH_LEN("SUBTIME"), BUILDER(Create_func_subtime)}, - { C_STRING_WITH_LEN("TAN"), BUILDER(Create_func_tan)}, - { C_STRING_WITH_LEN("TIMEDIFF"), BUILDER(Create_func_timediff)}, - { C_STRING_WITH_LEN("TIME_FORMAT"), BUILDER(Create_func_time_format)}, - { C_STRING_WITH_LEN("TIME_TO_SEC"), BUILDER(Create_func_time_to_sec)}, - { C_STRING_WITH_LEN("TOUCHES"), GEOM_BUILDER(Create_func_touches)}, - { C_STRING_WITH_LEN("TO_DAYS"), BUILDER(Create_func_to_days)}, - { C_STRING_WITH_LEN("UCASE"), BUILDER(Create_func_ucase)}, - { C_STRING_WITH_LEN("UNCOMPRESS"), BUILDER(Create_func_uncompress)}, - { C_STRING_WITH_LEN("UNCOMPRESSED_LENGTH"), BUILDER(Create_func_uncompressed_length)}, - { C_STRING_WITH_LEN("UNHEX"), BUILDER(Create_func_unhex)}, - { C_STRING_WITH_LEN("UNIX_TIMESTAMP"), BUILDER(Create_func_unix_timestamp)}, - { C_STRING_WITH_LEN("UPDATEXML"), BUILDER(Create_func_xml_update)}, - { C_STRING_WITH_LEN("UPPER"), BUILDER(Create_func_ucase)}, - { C_STRING_WITH_LEN("UUID"), BUILDER(Create_func_uuid)}, - { C_STRING_WITH_LEN("VERSION"), BUILDER(Create_func_version)}, - { C_STRING_WITH_LEN("WEEKDAY"), BUILDER(Create_func_weekday)}, - { C_STRING_WITH_LEN("WEEKOFYEAR"), BUILDER(Create_func_weekofyear)}, - { C_STRING_WITH_LEN("WITHIN"), GEOM_BUILDER(Create_func_within)}, - { C_STRING_WITH_LEN("X"), GEOM_BUILDER(Create_func_x)}, - { C_STRING_WITH_LEN("Y"), GEOM_BUILDER(Create_func_y)}, - { C_STRING_WITH_LEN("YEARWEEK"), BUILDER(Create_func_year_week)}, + { { STRING_WITH_LEN("ABS") }, BUILDER(Create_func_abs)}, + { { STRING_WITH_LEN("ACOS") }, BUILDER(Create_func_acos)}, + { { STRING_WITH_LEN("ADDTIME") }, BUILDER(Create_func_addtime)}, + { { STRING_WITH_LEN("AES_DECRYPT") }, BUILDER(Create_func_aes_decrypt)}, + { { STRING_WITH_LEN("AES_ENCRYPT") }, BUILDER(Create_func_aes_encrypt)}, + { { STRING_WITH_LEN("AREA") }, GEOM_BUILDER(Create_func_area)}, + { { STRING_WITH_LEN("ASBINARY") }, GEOM_BUILDER(Create_func_as_wkb)}, + { { STRING_WITH_LEN("ASIN") }, BUILDER(Create_func_asin)}, + { { STRING_WITH_LEN("ASTEXT") }, GEOM_BUILDER(Create_func_as_wkt)}, + { { STRING_WITH_LEN("ASWKB") }, GEOM_BUILDER(Create_func_as_wkb)}, + { { STRING_WITH_LEN("ASWKT") }, GEOM_BUILDER(Create_func_as_wkt)}, + { { STRING_WITH_LEN("ATAN") }, BUILDER(Create_func_atan)}, + { { STRING_WITH_LEN("ATAN2") }, BUILDER(Create_func_atan)}, + { { STRING_WITH_LEN("BENCHMARK") }, BUILDER(Create_func_benchmark)}, + { { STRING_WITH_LEN("BIN") }, BUILDER(Create_func_bin)}, + { { STRING_WITH_LEN("BIT_COUNT") }, BUILDER(Create_func_bit_count)}, + { { STRING_WITH_LEN("BIT_LENGTH") }, BUILDER(Create_func_bit_length)}, + { { STRING_WITH_LEN("CEIL") }, BUILDER(Create_func_ceiling)}, + { { STRING_WITH_LEN("CEILING") }, BUILDER(Create_func_ceiling)}, + { { STRING_WITH_LEN("CENTROID") }, GEOM_BUILDER(Create_func_centroid)}, + { { STRING_WITH_LEN("CHARACTER_LENGTH") }, BUILDER(Create_func_char_length)}, + { { STRING_WITH_LEN("CHAR_LENGTH") }, BUILDER(Create_func_char_length)}, + { { STRING_WITH_LEN("COERCIBILITY") }, BUILDER(Create_func_coercibility)}, + { { STRING_WITH_LEN("COMPRESS") }, BUILDER(Create_func_compress)}, + { { STRING_WITH_LEN("CONCAT") }, BUILDER(Create_func_concat)}, + { { STRING_WITH_LEN("CONCAT_WS") }, BUILDER(Create_func_concat_ws)}, + { { STRING_WITH_LEN("CONNECTION_ID") }, BUILDER(Create_func_connection_id)}, + { { STRING_WITH_LEN("CONV") }, BUILDER(Create_func_conv)}, + { { STRING_WITH_LEN("CONVERT_TZ") }, BUILDER(Create_func_convert_tz)}, + { { STRING_WITH_LEN("COS") }, BUILDER(Create_func_cos)}, + { { STRING_WITH_LEN("COT") }, BUILDER(Create_func_cot)}, + { { STRING_WITH_LEN("CRC32") }, BUILDER(Create_func_crc32)}, + { { STRING_WITH_LEN("CROSSES") }, GEOM_BUILDER(Create_func_crosses)}, + { { STRING_WITH_LEN("DATEDIFF") }, BUILDER(Create_func_datediff)}, + { { STRING_WITH_LEN("DATE_FORMAT") }, BUILDER(Create_func_date_format)}, + { { STRING_WITH_LEN("DAYNAME") }, BUILDER(Create_func_dayname)}, + { { STRING_WITH_LEN("DAYOFMONTH") }, BUILDER(Create_func_dayofmonth)}, + { { STRING_WITH_LEN("DAYOFWEEK") }, BUILDER(Create_func_dayofweek)}, + { { STRING_WITH_LEN("DAYOFYEAR") }, BUILDER(Create_func_dayofyear)}, + { { STRING_WITH_LEN("DECODE") }, BUILDER(Create_func_decode)}, + { { STRING_WITH_LEN("DEGREES") }, BUILDER(Create_func_degrees)}, + { { STRING_WITH_LEN("DES_DECRYPT") }, BUILDER(Create_func_des_decrypt)}, + { { STRING_WITH_LEN("DES_ENCRYPT") }, BUILDER(Create_func_des_encrypt)}, + { { STRING_WITH_LEN("DIMENSION") }, GEOM_BUILDER(Create_func_dimension)}, + { { STRING_WITH_LEN("DISJOINT") }, GEOM_BUILDER(Create_func_disjoint)}, + { { STRING_WITH_LEN("ELT") }, BUILDER(Create_func_elt)}, + { { STRING_WITH_LEN("ENCODE") }, BUILDER(Create_func_encode)}, + { { STRING_WITH_LEN("ENCRYPT") }, BUILDER(Create_func_encrypt)}, + { { STRING_WITH_LEN("ENDPOINT") }, GEOM_BUILDER(Create_func_endpoint)}, + { { STRING_WITH_LEN("ENVELOPE") }, GEOM_BUILDER(Create_func_envelope)}, + { { STRING_WITH_LEN("EQUALS") }, GEOM_BUILDER(Create_func_equals)}, + { { STRING_WITH_LEN("EXP") }, BUILDER(Create_func_exp)}, + { { STRING_WITH_LEN("EXPORT_SET") }, BUILDER(Create_func_export_set)}, + { { STRING_WITH_LEN("EXTERIORRING") }, GEOM_BUILDER(Create_func_exteriorring)}, + { { STRING_WITH_LEN("EXTRACTVALUE") }, BUILDER(Create_func_xml_extractvalue)}, + { { STRING_WITH_LEN("FIELD") }, BUILDER(Create_func_field)}, + { { STRING_WITH_LEN("FIND_IN_SET") }, BUILDER(Create_func_find_in_set)}, + { { STRING_WITH_LEN("FLOOR") }, BUILDER(Create_func_floor)}, + { { STRING_WITH_LEN("FORMAT") }, BUILDER(Create_func_format)}, + { { STRING_WITH_LEN("FOUND_ROWS") }, BUILDER(Create_func_found_rows)}, + { { STRING_WITH_LEN("FROM_DAYS") }, BUILDER(Create_func_from_days)}, + { { STRING_WITH_LEN("FROM_UNIXTIME") }, BUILDER(Create_func_from_unixtime)}, + { { STRING_WITH_LEN("GEOMCOLLFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("GEOMCOLLFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("GEOMETRYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("GEOMETRYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("GEOMETRYN") }, GEOM_BUILDER(Create_func_geometryn)}, + { { STRING_WITH_LEN("GEOMETRYTYPE") }, GEOM_BUILDER(Create_func_geometry_type)}, + { { STRING_WITH_LEN("GEOMFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("GEOMFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("GET_LOCK") }, BUILDER(Create_func_get_lock)}, + { { STRING_WITH_LEN("GLENGTH") }, GEOM_BUILDER(Create_func_glength)}, + { { STRING_WITH_LEN("GREATEST") }, BUILDER(Create_func_greatest)}, + { { STRING_WITH_LEN("HEX") }, BUILDER(Create_func_hex)}, + { { STRING_WITH_LEN("IFNULL") }, BUILDER(Create_func_ifnull)}, + { { STRING_WITH_LEN("INET_ATON") }, BUILDER(Create_func_inet_aton)}, + { { STRING_WITH_LEN("INET_NTOA") }, BUILDER(Create_func_inet_ntoa)}, + { { STRING_WITH_LEN("INSTR") }, BUILDER(Create_func_instr)}, + { { STRING_WITH_LEN("INTERIORRINGN") }, GEOM_BUILDER(Create_func_interiorringn)}, + { { STRING_WITH_LEN("INTERSECTS") }, GEOM_BUILDER(Create_func_intersects)}, + { { STRING_WITH_LEN("ISCLOSED") }, GEOM_BUILDER(Create_func_isclosed)}, + { { STRING_WITH_LEN("ISEMPTY") }, GEOM_BUILDER(Create_func_isempty)}, + { { STRING_WITH_LEN("ISNULL") }, BUILDER(Create_func_isnull)}, + { { STRING_WITH_LEN("ISSIMPLE") }, GEOM_BUILDER(Create_func_issimple)}, + { { STRING_WITH_LEN("IS_FREE_LOCK") }, BUILDER(Create_func_is_free_lock)}, + { { STRING_WITH_LEN("IS_USED_LOCK") }, BUILDER(Create_func_is_used_lock)}, + { { STRING_WITH_LEN("LAST_DAY") }, BUILDER(Create_func_last_day)}, + { { STRING_WITH_LEN("LAST_INSERT_ID") }, BUILDER(Create_func_last_insert_id)}, + { { STRING_WITH_LEN("LCASE") }, BUILDER(Create_func_lcase)}, + { { STRING_WITH_LEN("LEAST") }, BUILDER(Create_func_least)}, + { { STRING_WITH_LEN("LENGTH") }, BUILDER(Create_func_length)}, + { { STRING_WITH_LEN("LINEFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("LINEFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("LINESTRINGFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("LINESTRINGFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("LN") }, BUILDER(Create_func_ln)}, + { { STRING_WITH_LEN("LOAD_FILE") }, BUILDER(Create_func_load_file)}, + { { STRING_WITH_LEN("LOCATE") }, BUILDER(Create_func_locate)}, + { { STRING_WITH_LEN("LOG") }, BUILDER(Create_func_log)}, + { { STRING_WITH_LEN("LOG10") }, BUILDER(Create_func_log10)}, + { { STRING_WITH_LEN("LOG2") }, BUILDER(Create_func_log2)}, + { { STRING_WITH_LEN("LOWER") }, BUILDER(Create_func_lcase)}, + { { STRING_WITH_LEN("LPAD") }, BUILDER(Create_func_lpad)}, + { { STRING_WITH_LEN("LTRIM") }, BUILDER(Create_func_ltrim)}, + { { STRING_WITH_LEN("MAKEDATE") }, BUILDER(Create_func_makedate)}, + { { STRING_WITH_LEN("MAKETIME") }, BUILDER(Create_func_maketime)}, + { { STRING_WITH_LEN("MAKE_SET") }, BUILDER(Create_func_make_set)}, + { { STRING_WITH_LEN("MASTER_POS_WAIT") }, BUILDER(Create_func_master_pos_wait)}, + { { STRING_WITH_LEN("MBRCONTAINS") }, GEOM_BUILDER(Create_func_contains)}, + { { STRING_WITH_LEN("MD5") }, BUILDER(Create_func_md5)}, + { { STRING_WITH_LEN("MLINEFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("MLINEFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("MONTHNAME") }, BUILDER(Create_func_monthname)}, + { { STRING_WITH_LEN("MPOINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("MPOINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("MPOLYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("MPOLYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("MULTILINESTRINGFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("MULTILINESTRINGFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("MULTIPOINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("MULTIPOINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("MULTIPOLYGONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("MULTIPOLYGONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("NAME_CONST") }, BUILDER(Create_func_name_const)}, + { { STRING_WITH_LEN("NULLIF") }, BUILDER(Create_func_nullif)}, + { { STRING_WITH_LEN("NUMGEOMETRIES") }, GEOM_BUILDER(Create_func_numgeometries)}, + { { STRING_WITH_LEN("NUMINTERIORRINGS") }, GEOM_BUILDER(Create_func_numinteriorring)}, + { { STRING_WITH_LEN("NUMPOINTS") }, GEOM_BUILDER(Create_func_numpoints)}, + { { STRING_WITH_LEN("OCT") }, BUILDER(Create_func_oct)}, + { { STRING_WITH_LEN("OCTET_LENGTH") }, BUILDER(Create_func_length)}, + { { STRING_WITH_LEN("ORD") }, BUILDER(Create_func_ord)}, + { { STRING_WITH_LEN("OVERLAPS") }, GEOM_BUILDER(Create_func_overlaps)}, + { { STRING_WITH_LEN("PERIOD_ADD") }, BUILDER(Create_func_period_add)}, + { { STRING_WITH_LEN("PERIOD_DIFF") }, BUILDER(Create_func_period_diff)}, + { { STRING_WITH_LEN("PI") }, BUILDER(Create_func_pi)}, + { { STRING_WITH_LEN("POINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("POINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("POINTN") }, GEOM_BUILDER(Create_func_pointn)}, + { { STRING_WITH_LEN("POLYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("POLYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("POLYGONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, + { { STRING_WITH_LEN("POLYGONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, + { { STRING_WITH_LEN("POW") }, BUILDER(Create_func_pow)}, + { { STRING_WITH_LEN("POWER") }, BUILDER(Create_func_pow)}, + { { STRING_WITH_LEN("QUOTE") }, BUILDER(Create_func_quote)}, + { { STRING_WITH_LEN("RADIANS") }, BUILDER(Create_func_radians)}, + { { STRING_WITH_LEN("RAND") }, BUILDER(Create_func_rand)}, + { { STRING_WITH_LEN("RELEASE_LOCK") }, BUILDER(Create_func_release_lock)}, + { { STRING_WITH_LEN("REVERSE") }, BUILDER(Create_func_reverse)}, + { { STRING_WITH_LEN("ROUND") }, BUILDER(Create_func_round)}, + { { STRING_WITH_LEN("ROW_COUNT") }, BUILDER(Create_func_row_count)}, + { { STRING_WITH_LEN("RPAD") }, BUILDER(Create_func_rpad)}, + { { STRING_WITH_LEN("RTRIM") }, BUILDER(Create_func_rtrim)}, + { { STRING_WITH_LEN("SEC_TO_TIME") }, BUILDER(Create_func_sec_to_time)}, + { { STRING_WITH_LEN("SHA") }, BUILDER(Create_func_sha)}, + { { STRING_WITH_LEN("SHA1") }, BUILDER(Create_func_sha)}, + { { STRING_WITH_LEN("SIGN") }, BUILDER(Create_func_sign)}, + { { STRING_WITH_LEN("SIN") }, BUILDER(Create_func_sin)}, + { { STRING_WITH_LEN("SLEEP") }, BUILDER(Create_func_sleep)}, + { { STRING_WITH_LEN("SOUNDEX") }, BUILDER(Create_func_soundex)}, + { { STRING_WITH_LEN("SPACE") }, BUILDER(Create_func_space)}, + { { STRING_WITH_LEN("SQRT") }, BUILDER(Create_func_sqrt)}, + { { STRING_WITH_LEN("SRID") }, GEOM_BUILDER(Create_func_srid)}, + { { STRING_WITH_LEN("STARTPOINT") }, GEOM_BUILDER(Create_func_startpoint)}, + { { STRING_WITH_LEN("STRCMP") }, BUILDER(Create_func_strcmp)}, + { { STRING_WITH_LEN("STR_TO_DATE") }, BUILDER(Create_func_str_to_date)}, + { { STRING_WITH_LEN("SUBSTRING_INDEX") }, BUILDER(Create_func_substr_index)}, + { { STRING_WITH_LEN("SUBTIME") }, BUILDER(Create_func_subtime)}, + { { STRING_WITH_LEN("TAN") }, BUILDER(Create_func_tan)}, + { { STRING_WITH_LEN("TIMEDIFF") }, BUILDER(Create_func_timediff)}, + { { STRING_WITH_LEN("TIME_FORMAT") }, BUILDER(Create_func_time_format)}, + { { STRING_WITH_LEN("TIME_TO_SEC") }, BUILDER(Create_func_time_to_sec)}, + { { STRING_WITH_LEN("TOUCHES") }, GEOM_BUILDER(Create_func_touches)}, + { { STRING_WITH_LEN("TO_DAYS") }, BUILDER(Create_func_to_days)}, + { { STRING_WITH_LEN("UCASE") }, BUILDER(Create_func_ucase)}, + { { STRING_WITH_LEN("UNCOMPRESS") }, BUILDER(Create_func_uncompress)}, + { { STRING_WITH_LEN("UNCOMPRESSED_LENGTH") }, BUILDER(Create_func_uncompressed_length)}, + { { STRING_WITH_LEN("UNHEX") }, BUILDER(Create_func_unhex)}, + { { STRING_WITH_LEN("UNIX_TIMESTAMP") }, BUILDER(Create_func_unix_timestamp)}, + { { STRING_WITH_LEN("UPDATEXML") }, BUILDER(Create_func_xml_update)}, + { { STRING_WITH_LEN("UPPER") }, BUILDER(Create_func_ucase)}, + { { STRING_WITH_LEN("UUID") }, BUILDER(Create_func_uuid)}, + { { STRING_WITH_LEN("VERSION") }, BUILDER(Create_func_version)}, + { { STRING_WITH_LEN("WEEKDAY") }, BUILDER(Create_func_weekday)}, + { { STRING_WITH_LEN("WEEKOFYEAR") }, BUILDER(Create_func_weekofyear)}, + { { STRING_WITH_LEN("WITHIN") }, GEOM_BUILDER(Create_func_within)}, + { { STRING_WITH_LEN("X") }, GEOM_BUILDER(Create_func_x)}, + { { STRING_WITH_LEN("Y") }, GEOM_BUILDER(Create_func_y)}, + { { STRING_WITH_LEN("YEARWEEK") }, BUILDER(Create_func_year_week)}, { {0, 0}, NULL} }; diff --git a/sql/log.cc b/sql/log.cc index 59fa08a4217..36199499dc4 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1914,8 +1914,8 @@ shutdown the MySQL server and restart it.", name, errno); } MYSQL_LOG::MYSQL_LOG() - : name(0), log_type(LOG_UNKNOWN), log_state(LOG_CLOSED), write_error(FALSE), - inited(FALSE) + : name(0), write_error(FALSE), inited(FALSE), log_type(LOG_UNKNOWN), + log_state(LOG_CLOSED) { /* We don't want to initialize LOCK_Log here as such initialization depends on diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c1ba05e24bd..8c9ac865292 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2651,7 +2651,7 @@ static bool init_global_datetime_format(timestamp_type format_type, static int init_common_variables(const char *conf_file_name, int argc, char **argv, const char **groups) { - char buff[FN_REFLEN]; + char buff[FN_REFLEN], *s; umask(((~my_umask) & 0666)); my_decimal_set_zero(&decimal_zero); // set decimal_zero constant; tzset(); // Set tzname @@ -2857,15 +2857,13 @@ static int init_common_variables(const char *conf_file_name, int argc, "--log-slow-queries option, log tables are used. " "To enable logging to files use the --log-output option."); - if (!opt_logname) - opt_logname= make_default_log_name(buff, ".log"); - sys_var_general_log_path.value= my_strdup(opt_logname, MYF(0)); - sys_var_general_log_path.value_length= strlen(opt_logname); + s= opt_logname ? opt_logname : make_default_log_name(buff, ".log"); + sys_var_general_log_path.value= my_strdup(s, MYF(0)); + sys_var_general_log_path.value_length= strlen(s); - if (!opt_slow_logname) - opt_slow_logname= make_default_log_name(buff, "-slow.log"); - sys_var_slow_log_path.value= my_strdup(opt_slow_logname, MYF(0)); - sys_var_slow_log_path.value_length= strlen(opt_slow_logname); + s= opt_slow_logname ? opt_slow_logname : make_default_log_name(buff, "-slow.log"); + sys_var_slow_log_path.value= my_strdup(s, MYF(0)); + sys_var_slow_log_path.value_length= strlen(s); if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1)) return 1; @@ -3280,7 +3278,7 @@ server."); using_update_log=1; } - if (plugin_init(&defaults_argc, defaults_argv, + if (plugin_init(&defaults_argc, defaults_argv, (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) | (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0))) { @@ -3295,25 +3293,28 @@ server."); if (defaults_argc > 1) { int ho_error; - struct my_option no_opts[] = + char **tmp_argv= defaults_argv; + struct my_option no_opts[]= { {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; /* We need to eat any 'loose' arguments first before we conclude - that there are unprocessed options + that there are unprocessed options. + But we need to preserve defaults_argv pointer intact for + free_defaults() to work. Thus we use a copy here. */ my_getopt_skip_unknown= 0; - - if ((ho_error= handle_options(&defaults_argc, &defaults_argv, no_opts, + + if ((ho_error= handle_options(&defaults_argc, &tmp_argv, no_opts, get_one_option))) unireg_abort(ho_error); - + if (defaults_argc) { fprintf(stderr, "%s: Too many arguments (first extra is '%s').\n" - "Use --verbose --help to get a list of available options\n", - my_progname, *defaults_argv); + "Use --verbose --help to get a list of available options\n", + my_progname, *tmp_argv); unireg_abort(1); } } diff --git a/sql/partition_element.h b/sql/partition_element.h index c056d40b85b..905bc38165b 100644 --- a/sql/partition_element.h +++ b/sql/partition_element.h @@ -84,9 +84,9 @@ public: partition_element(partition_element *part_elem) : part_max_rows(part_elem->part_max_rows), part_min_rows(part_elem->part_min_rows), - partition_name(NULL), + range_value(0), partition_name(NULL), tablespace_name(part_elem->tablespace_name), - range_value(0), part_comment(part_elem->part_comment), + part_comment(part_elem->part_comment), data_file_name(part_elem->data_file_name), index_file_name(part_elem->index_file_name), engine_type(part_elem->engine_type), diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 34cebf93ddb..9c4c4890942 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -64,7 +64,7 @@ public: size Number of elements in array 'types' */ table_def(field_type *types, my_size_t size) - : m_type(types), m_size(size) + : m_size(size), m_type(types) { } diff --git a/sql/set_var.cc b/sql/set_var.cc index 7b27902571b..cab023441a0 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -27,8 +27,6 @@ of it in the my_option structure list in mysqld.cc - Don't forget to initialize new fields in global_system_variables and max_system_variables! - - If the variable should show up in 'show variables' add it to the - init_vars[] struct in this file NOTES: - Be careful with var->save_result: sys_var::check() only updates diff --git a/sql/set_var.h b/sql/set_var.h index 2813a756b8e..dedd0d35716 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -641,12 +641,12 @@ public: class sys_var_character_set_sv :public sys_var_character_set { - CHARSET_INFO **global_default; CHARSET_INFO *SV::*offset; + CHARSET_INFO **global_default; public: sys_var_character_set_sv(sys_var_chain *chain, const char *name_arg, CHARSET_INFO *SV::*offset_arg, - CHARSET_INFO **global_default_arg, + CHARSET_INFO **global_default_arg, bool is_nullable= 0) : sys_var_character_set(name_arg, is_nullable), offset(offset_arg), global_default(global_default_arg) @@ -668,8 +668,8 @@ public: class sys_var_collation_sv :public sys_var_collation { - CHARSET_INFO **global_default; CHARSET_INFO *SV::*offset; + CHARSET_INFO **global_default; public: sys_var_collation_sv(sys_var_chain *chain, const char *name_arg, CHARSET_INFO *SV::*offset_arg, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 9fba5b92ba5..20d12a4bd62 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -227,8 +227,8 @@ int thd_sql_command(const THD *thd) pointer to string */ extern "C" -char *thd_security_context(THD *thd, char *buffer, int length, - int max_query_len) +char *thd_security_context(THD *thd, char *buffer, unsigned int length, + unsigned int max_query_len) { String str(buffer, length, &my_charset_latin1); const Security_context *sctx= &thd->main_security_ctx; @@ -293,13 +293,16 @@ THD::THD() user_time(0), in_sub_stmt(0), binlog_table_maps(0), global_read_lock(0), is_fatal_error(0), - rand_used(0), time_zone_used(0), arg_of_last_insert_id_function(FALSE), first_successful_insert_id_in_prev_stmt(0), first_successful_insert_id_in_prev_stmt_for_binlog(0), first_successful_insert_id_in_cur_stmt(0), - in_lock_tables(0), bootstrap(0), derived_tables_processing(FALSE), + rand_used(0), + time_zone_used(0), + in_lock_tables(0), stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE), + bootstrap(0), + derived_tables_processing(FALSE), spcont(NULL) { ulong tmp; @@ -1765,15 +1768,16 @@ void Query_arena::cleanup_stmt() } /* - Statement functions + Statement functions */ Statement::Statement(enum enum_state state_arg, ulong id_arg, ulong alloc_block_size, ulong prealloc_size) :Query_arena(&main_mem_root, state_arg), + main_lex(), id(id_arg), mark_used_columns(MARK_COLUMNS_READ), - main_lex(), lex(&main_lex), + lex(&main_lex), query(0), query_length(0), cursor(0) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ce7f34e3a06..f33e7ffec1f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -43,37 +43,37 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables); const char *any_db="*any*"; // Special symbol for check_access const LEX_STRING command_name[]={ - C_STRING_WITH_LEN("Sleep"), - C_STRING_WITH_LEN("Quit"), - C_STRING_WITH_LEN("Init DB"), - C_STRING_WITH_LEN("Query"), - C_STRING_WITH_LEN("Field List"), - C_STRING_WITH_LEN("Create DB"), - C_STRING_WITH_LEN("Drop DB"), - C_STRING_WITH_LEN("Refresh"), - C_STRING_WITH_LEN("Shutdown"), - C_STRING_WITH_LEN("Statistics"), - C_STRING_WITH_LEN("Processlist"), - C_STRING_WITH_LEN("Connect"), - C_STRING_WITH_LEN("Kill"), - C_STRING_WITH_LEN("Debug"), - C_STRING_WITH_LEN("Ping"), - C_STRING_WITH_LEN("Time"), - C_STRING_WITH_LEN("Delayed insert"), - C_STRING_WITH_LEN("Change user"), - C_STRING_WITH_LEN("Binlog Dump"), - C_STRING_WITH_LEN("Table Dump"), - C_STRING_WITH_LEN("Connect Out"), - C_STRING_WITH_LEN("Register Slave"), - C_STRING_WITH_LEN("Prepare"), - C_STRING_WITH_LEN("Execute"), - C_STRING_WITH_LEN("Long Data"), - C_STRING_WITH_LEN("Close stmt"), - C_STRING_WITH_LEN("Reset stmt"), - C_STRING_WITH_LEN("Set option"), - C_STRING_WITH_LEN("Fetch"), - C_STRING_WITH_LEN("Daemon"), - C_STRING_WITH_LEN("Error") // Last command number + { STRING_WITH_LEN("Sleep") }, + { STRING_WITH_LEN("Quit") }, + { STRING_WITH_LEN("Init DB") }, + { STRING_WITH_LEN("Query") }, + { STRING_WITH_LEN("Field List") }, + { STRING_WITH_LEN("Create DB") }, + { STRING_WITH_LEN("Drop DB") }, + { STRING_WITH_LEN("Refresh") }, + { STRING_WITH_LEN("Shutdown") }, + { STRING_WITH_LEN("Statistics") }, + { STRING_WITH_LEN("Processlist") }, + { STRING_WITH_LEN("Connect") }, + { STRING_WITH_LEN("Kill") }, + { STRING_WITH_LEN("Debug") }, + { STRING_WITH_LEN("Ping") }, + { STRING_WITH_LEN("Time") }, + { STRING_WITH_LEN("Delayed insert") }, + { STRING_WITH_LEN("Change user") }, + { STRING_WITH_LEN("Binlog Dump") }, + { STRING_WITH_LEN("Table Dump") }, + { STRING_WITH_LEN("Connect Out") }, + { STRING_WITH_LEN("Register Slave") }, + { STRING_WITH_LEN("Prepare") }, + { STRING_WITH_LEN("Execute") }, + { STRING_WITH_LEN("Long Data") }, + { STRING_WITH_LEN("Close stmt") }, + { STRING_WITH_LEN("Reset stmt") }, + { STRING_WITH_LEN("Set option") }, + { STRING_WITH_LEN("Fetch") }, + { STRING_WITH_LEN("Daemon") }, + { STRING_WITH_LEN("Error") } // Last command number }; const char *xa_state_names[]={ diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 6da247ee153..df826e4cdd6 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -138,7 +138,7 @@ struct st_bookmark uint name_len; int offset; uint version; - char key[0]; + char key[1]; }; @@ -187,11 +187,10 @@ public: static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv); static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, const char *list); -static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, - int *argc, char **argv, my_bool default_enabled); -static bool register_builtin(struct st_mysql_plugin *plugin, - struct st_plugin_int *tmp, - struct st_plugin_int **ptr); +static int test_plugin_options(MEM_ROOT *, struct st_plugin_int *, + int *, char **, my_bool); +static bool register_builtin(struct st_mysql_plugin *, struct st_plugin_int *, + struct st_plugin_int **); static void unlock_variables(THD *thd, struct system_variables *vars); static void cleanup_variables(THD *thd, struct system_variables *vars); static void plugin_opt_set_limits(struct my_option *options, @@ -242,44 +241,20 @@ static const char *item_val_str(struct st_mysql_value *value, } -static int item_val_int(struct st_mysql_value *value, void *buf, int intsize) +static int item_val_int(struct st_mysql_value *value, long long *buf) { Item *item= ((st_item_value_holder*)value)->item; - switch (intsize) { - case 1: - *(char*)buf= item->val_int(); - break; - case 2: - *(short*)buf= item->val_int(); - break; - case 4: - *(int*)buf= item->val_int(); - break; - case 8: - *(longlong*)buf= item->val_int(); - break; - default: - return -1; - } + *buf= item->val_int(); if (item->is_null()) return 1; return 0; } -static int item_val_real(struct st_mysql_value *value, void *buf, int realsize) +static int item_val_real(struct st_mysql_value *value, double *buf) { Item *item= ((st_item_value_holder*)value)->item; - switch (realsize) { - case 8: - *(double*)buf= item->val_real(); - break; - case 4: - *(float*)buf= item->val_real(); - break; - default: - return -1; - } + *buf= item->val_real(); if (item->is_null()) return 1; return 0; @@ -794,8 +769,7 @@ err: } -static void plugin_deinitialize(struct st_plugin_int *plugin, - bool ref_check= TRUE) +static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check) { /* we don't want to hold the LOCK_plugin mutex as it may cause @@ -911,7 +885,7 @@ static void reap_plugins(void) list= reap; while ((plugin= *(--list))) - plugin_deinitialize(plugin); + plugin_deinitialize(plugin, true); pthread_mutex_lock(&LOCK_plugin); @@ -1149,6 +1123,8 @@ int plugin_init(int *argc, char **argv, int flags) my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0; bzero(&tmp, sizeof(tmp)); tmp.plugin= plugin; + tmp.name.str= (char *)plugin->name; + tmp.name.length= strlen(plugin->name); free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE)); if (test_plugin_options(&tmp_root, &tmp, argc, argv, def_enabled)) @@ -1226,7 +1202,7 @@ int plugin_init(int *argc, char **argv, int flags) while ((plugin_ptr= *(--reap))) { pthread_mutex_unlock(&LOCK_plugin); - plugin_deinitialize(plugin_ptr); + plugin_deinitialize(plugin_ptr, true); pthread_mutex_lock(&LOCK_plugin); plugin_del(plugin_ptr); } @@ -1252,9 +1228,6 @@ static bool register_builtin(struct st_mysql_plugin *plugin, { DBUG_ENTER("register_builtin"); - tmp->plugin= plugin; - tmp->name.str= (char *)plugin->name; - tmp->name.length= strlen(plugin->name); tmp->state= PLUGIN_IS_UNINITIALIZED; tmp->ref_count= 0; tmp->plugin_dl= 0; @@ -1294,6 +1267,8 @@ bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin) bzero(&tmp, sizeof(tmp)); tmp.plugin= plugin; + tmp.name.str= (char *)plugin->name; + tmp.name.length= strlen(plugin->name); pthread_mutex_lock(&LOCK_plugin); rw_wrlock(&LOCK_system_variables_hash); @@ -1451,7 +1426,7 @@ error: void plugin_shutdown(void) { - uint i, count= plugin_array.elements; + uint i, count= plugin_array.elements, free_slots; struct st_plugin_int **plugins, *plugin; struct st_plugin_dl **dl; DBUG_ENTER("plugin_shutdown"); @@ -1472,13 +1447,18 @@ void plugin_shutdown(void) while (reap_needed && (count= plugin_array.elements)) { reap_plugins(); - for (i= 0; i < count; i++) + for (i= free_slots= 0; i < count; i++) { plugin= dynamic_element(&plugin_array, i, struct st_plugin_int *); - if (plugin->state == PLUGIN_IS_READY) - { + switch (plugin->state) { + case PLUGIN_IS_READY: plugin->state= PLUGIN_IS_DELETED; reap_needed= true; + break; + case PLUGIN_IS_FREED: + case PLUGIN_IS_UNINITIALIZED: + free_slots++; + break; } } if (!reap_needed) @@ -1491,8 +1471,8 @@ void plugin_shutdown(void) } } - if (count > 0) - sql_print_warning("Forcing shutdown of %d plugins", count); + if (count > free_slots) + sql_print_warning("Forcing shutdown of %d plugins", count - free_slots); plugins= (struct st_plugin_int **) my_alloca(sizeof(void*) * (count+1)); @@ -1523,26 +1503,30 @@ void plugin_shutdown(void) plugin_deinitialize(plugins[i], false); } + /* + It's perfectly safe not to lock LOCK_plugin, as there're no + concurrent threads anymore. But some functions called from here + use safe_mutex_assert_owner(), so we lock the mutex to satisfy it + */ + pthread_mutex_lock(&LOCK_plugin); /* We defer checking ref_counts until after all plugins are deinitialized as some may have worker threads holding on to plugin references. */ for (i= 0; i < count; i++) + { if (plugins[i]->ref_count) sql_print_error("Plugin '%s' has ref_count=%d after shutdown.", plugins[i]->name.str, plugins[i]->ref_count); - - for (i= 0; i < count; i++) if (plugins[i]->state & PLUGIN_IS_UNINITIALIZED) plugin_del(plugins[i]); + } /* Now we can deallocate all memory. */ - /* neccessary to avoid safe_mutex_assert_owner() trap */ - pthread_mutex_lock(&LOCK_plugin); cleanup_variables(NULL, &global_system_variables); cleanup_variables(NULL, &max_system_variables); pthread_mutex_unlock(&LOCK_plugin); @@ -1802,7 +1786,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, char buff[STRING_BUFFER_USUAL_SIZE]; const char *strvalue= "NULL", *str; int result, length; - ulonglong tmp; + long long tmp; if (value->value_type(value) == MYSQL_VALUE_TYPE_STRING) { @@ -1817,7 +1801,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, } else { - if (value->val_int(value, &tmp, sizeof(tmp)) < 0) + if (value->val_int(value, &tmp) < 0) goto err; if (tmp > 1) { @@ -1838,9 +1822,9 @@ err: static int check_func_int(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - ulonglong tmp; + long long tmp; struct my_option options; - value->val_int(value, &tmp, sizeof(tmp)); + value->val_int(value, &tmp); plugin_opt_set_limits(&options, var); *(int *)save= (int) getopt_ull_limit_value(tmp, &options); return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) && @@ -1851,9 +1835,9 @@ static int check_func_int(THD *thd, struct st_mysql_sys_var *var, static int check_func_long(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - ulonglong tmp; + long long tmp; struct my_option options; - value->val_int(value, &tmp, sizeof(tmp)); + value->val_int(value, &tmp); plugin_opt_set_limits(&options, var); *(long *)save= (long) getopt_ull_limit_value(tmp, &options); return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) && @@ -1864,13 +1848,13 @@ static int check_func_long(THD *thd, struct st_mysql_sys_var *var, static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - ulonglong tmp; + long long tmp; struct my_option options; - value->val_int(value, &tmp, sizeof(tmp)); + value->val_int(value, &tmp); plugin_opt_set_limits(&options, var); *(ulonglong *)save= getopt_ull_limit_value(tmp, &options); return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) && - (*(ulonglong *)save != tmp); + (*(long long *)save != tmp); } static int check_func_str(THD *thd, struct st_mysql_sys_var *var, @@ -1894,7 +1878,7 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var, char buff[STRING_BUFFER_USUAL_SIZE]; const char *strvalue= "NULL", *str; TYPELIB *typelib; - ulonglong tmp; + long long tmp; long result; int length; @@ -1916,7 +1900,7 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var, } else { - if (value->val_int(value, &tmp, sizeof(tmp))) + if (value->val_int(value, &tmp)) goto err; if (tmp >= typelib->count) { @@ -1967,7 +1951,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var, } else { - if (value->val_int(value, &tmp, sizeof(tmp))) + if (value->val_int(value, (long long *)&tmp)) goto err; if (unlikely((tmp >= (ULL(1) << typelib->count)) && (typelib->count < sizeof(long)*8))) @@ -2156,7 +2140,7 @@ static st_bookmark *register_var(const char *plugin, const char *name, if (!(result= find_bookmark(NULL, varname + 1, flags))) { result= (st_bookmark*) alloc_root(&plugin_mem_root, - sizeof(struct st_bookmark) + length); + sizeof(struct st_bookmark) + length-1); varname[0]= flags & PLUGIN_VAR_TYPEMASK; memcpy(result->key, varname, length); result->name_len= length - 2; @@ -2349,6 +2333,8 @@ static void cleanup_variables(THD *thd, struct system_variables *vars) } rw_unlock(&LOCK_system_variables_hash); + DBUG_ASSERT(vars->table_plugin == NULL); + my_free(vars->dynamic_variables_ptr, MYF(MY_ALLOW_ZERO_PTR)); vars->dynamic_variables_ptr= NULL; vars->dynamic_variables_size= 0; @@ -2680,10 +2666,9 @@ static my_bool get_one_option(int optid __attribute__((unused)), } -static int construct_options(MEM_ROOT *mem_root, - struct st_plugin_int *tmp, - my_option *options, - my_bool **enabled, bool can_disable) +static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, + my_option *options, my_bool **enabled, + bool can_disable) { const char *plugin_name= tmp->plugin->name; uint namelen= strlen(plugin_name), optnamelen; @@ -2707,7 +2692,7 @@ static int construct_options(MEM_ROOT *mem_root, if (can_disable) { strxmov(name + namelen*2 + 10, "Enable ", plugin_name, " plugin. " - "Disable with --skip-plugin-", name," (will save memory).", NullS); + "Disable with --skip-", name," (will save memory).", NullS); options[0].comment= name + namelen*2 + 10; } @@ -2868,7 +2853,7 @@ static int construct_options(MEM_ROOT *mem_root, options[1]= options[0]; options[1].name= p= (char*) alloc_root(mem_root, optnamelen + 8); - options[1].comment= NULL; /* hide this option */ + options[1].comment= 0; // hidden strxmov(p, "plugin-", optname, NullS); options+= 2; @@ -2883,19 +2868,23 @@ static my_option *construct_help_options(MEM_ROOT *mem_root, { st_mysql_sys_var **opt; my_option *opts; - my_bool dummy; + my_bool dummy, can_disable; my_bool *dummy2= &dummy; uint count= EXTRA_OPTIONS; DBUG_ENTER("construct_help_options"); - for (opt= p->plugin->system_vars; opt && *opt; opt++, count++); + for (opt= p->plugin->system_vars; opt && *opt; opt++, count+= 2); if (!(opts= (my_option*) alloc_root(mem_root, sizeof(my_option) * count))) DBUG_RETURN(NULL); bzero(opts, sizeof(my_option) * count); - if (construct_options(mem_root, p, opts, &dummy2, FALSE)) + can_disable= + my_strcasecmp(&my_charset_latin1, p->name.str, "MyISAM") && + my_strcasecmp(&my_charset_latin1, p->name.str, "MEMORY"); + + if (construct_options(mem_root, p, opts, &dummy2, can_disable)) DBUG_RETURN(NULL); DBUG_RETURN(opts); @@ -2932,27 +2921,27 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, struct st_bookmark *var; uint len, count= EXTRA_OPTIONS; DBUG_ENTER("test_plugin_options"); - DBUG_ASSERT(tmp->plugin && tmp->plugin->name); + DBUG_ASSERT(tmp->plugin && tmp->name.str); for (opt= tmp->plugin->system_vars; opt && *opt; opt++) count+= 2; /* --{plugin}-{optname} and --plugin-{plugin}-{optname} */ can_disable= - my_strcasecmp(&my_charset_latin1, tmp->plugin->name, "MyISAM") && - my_strcasecmp(&my_charset_latin1, tmp->plugin->name, "MEMORY"); + my_strcasecmp(&my_charset_latin1, tmp->name.str, "MyISAM") && + my_strcasecmp(&my_charset_latin1, tmp->name.str, "MEMORY"); if (count > EXTRA_OPTIONS || (*argc > 1)) { if (!(opts= (my_option*) alloc_root(tmp_root, sizeof(my_option) * count))) { - sql_print_error("Out of memory for plugin '%s'.", tmp->plugin->name); + sql_print_error("Out of memory for plugin '%s'.", tmp->name.str); DBUG_RETURN(-1); } bzero(opts, sizeof(my_option) * count); if (construct_options(tmp_root, tmp, opts, &enabled, can_disable)) { - sql_print_error("Bad options for plugin '%s'.", tmp->plugin->name); + sql_print_error("Bad options for plugin '%s'.", tmp->name.str); DBUG_RETURN(-1); } @@ -2962,14 +2951,14 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, if (error) { sql_print_error("Parsing options for plugin '%s' failed.", - tmp->plugin->name); + tmp->name.str); DBUG_RETURN(error); } } if (!*enabled && !can_disable) { - sql_print_warning("Plugin '%s' cannot be disabled", tmp->plugin->name); + sql_print_warning("Plugin '%s' cannot be disabled", tmp->name.str); *enabled= TRUE; } @@ -2980,13 +2969,13 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, if (((o= *opt)->flags & PLUGIN_VAR_NOSYSVAR)) continue; - if ((var= find_bookmark(tmp->plugin->name, o->name, o->flags))) + if ((var= find_bookmark(tmp->name.str, o->name, o->flags))) v= new (mem_root) sys_var_pluginvar(var->key + 1, o); else { - len= strlen(tmp->plugin->name) + strlen(o->name) + 2; + len= tmp->name.length + strlen(o->name) + 2; varname= (char*) alloc_root(mem_root, len); - strxmov(varname, tmp->plugin->name, "-", o->name, NullS); + strxmov(varname, tmp->name.str, "-", o->name, NullS); my_casedn_str(&my_charset_latin1, varname); for (p= varname; *p; p++) @@ -3010,7 +2999,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, if (mysql_add_sys_var_chain(chain.first, NULL)) { sql_print_error("Plugin '%s' has conflicting system variables", - tmp->plugin->name); + tmp->name.str); DBUG_RETURN(1); } tmp->system_vars= chain.first; @@ -3020,7 +3009,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, if (enabled_saved) sql_print_information("Plugin '%s' disabled by command line option", - tmp->plugin->name); + tmp->name.str); DBUG_RETURN(1); } |