Skip to content
Permalink
Browse files
MDEV-15692: install_spider.sql can fail with some collations
The error occurs because of how the character set and collation are chosen for
stored procedure parameters that have a character data type.  If the character
set and collation are not explicitly stated in the declaration, the server
chooses the database character set and collation in effect at routine creation
time.

To fix the problem, I added explicit character set and collation attributes
for the stored procedure parameters in the install_spider.sql script.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.
  • Loading branch information
Jacob Mathew committed Apr 5, 2018
1 parent 2b0c6b7 commit ff0bf45
Showing 1 changed file with 3 additions and 1 deletion.
@@ -166,7 +166,9 @@ drop procedure if exists mysql.spider_fix_one_table;
drop procedure if exists mysql.spider_fix_system_tables;
delimiter //
create procedure mysql.spider_fix_one_table
(tab_name char(255), test_col_name char(255), _sql text)
(tab_name char(255) charset utf8 collate utf8_bin,
test_col_name char(255) charset utf8 collate utf8_bin,
_sql text charset utf8 collate utf8_bin)
begin
set @col_exists := 0;
select 1 into @col_exists from INFORMATION_SCHEMA.COLUMNS

0 comments on commit ff0bf45

Please sign in to comment.