[MDEV-8640] MariaDB 10.1 with Spider Created: 2015-08-18  Updated: 2023-05-23  Resolved: 2023-05-23

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 10.1.6, 5.5, 10.0
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Aurélien LEQUOY Assignee: Nayuta Yanagisawa (Inactive)
Resolution: Won't Fix Votes: 0
Labels: upstream
Environment:

Centos 6.X



 Description   

installed MariaDB 10.1.6 with file_key_managment

when I installed spider :

most fine except this error :

mysql> source /usr/share/mysql/install_spider.sql
[...]
ERROR 1267 (HY000) at line 288 file '/usr/share/mysql/install_spider.sql': Illegal mix of collation (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='
[...]



 Comments   
Comment by Aurélien LEQUOY [ 2015-08-18 ]

got the same error, on a server stand alone

Comment by Aurélien LEQUOY [ 2015-08-18 ]

due to my.cnf

collation was specified in my.cnf
[mysqld]
collation_server = utf8_unicode_ci

cluster control set this options by default, I replace it by general_ci and all work fine

Comment by Elena Stepanova [ 2015-08-18 ]

Before I close it as a configuration issue, I want to get a consult from bar, because I find the behavior rather confusing.
It has nothing to do with Spider, the problem boils down to the following:

# Server should be started with 
# --collation-server=utf8_unicode_ci --character-set-server=utf8
 
drop procedure if exists p1;
 
# This works
select count(*) from INFORMATION_SCHEMA.COLUMNS
  where COLUMN_NAME = 'server';
 
create procedure p1 (c char(255))
  select count(*) from INFORMATION_SCHEMA.COLUMNS
    where COLUMN_NAME = c;
 
# But this does not
call p1('server');

So, when the server is started with such charset/collation, the comparison of the I_S column to a literal works okay as a plain SQL, but inside a procedure it fails. It's the same on earlier versions, both MariaDB and MySQL, but I'm not sure it's supposed to be so.

Comment by Aurélien LEQUOY [ 2015-08-18 ]

it's strange :

--collation-server=utf8_unicode_ci !
because it failed with that and worked with general_ci

Comment by Alexander Barkov [ 2017-11-05 ]

Stored routine variables and parameters use the database character set and collation by default.
To avoid this error, one should use explicit CHARACTER SET and COLLATE clauses at CREATE PROCEDURE time, e.g.:

create procedure p1 (c char(255) character set utf8 collate utf8_general_ci)
  select count(*) from INFORMATION_SCHEMA.COLUMNS
    where COLUMN_NAME = c;

Another option is to use explicit COLLATE in SELECT, e.g.:

create procedure p1 (c char(255))
  select count(*) from INFORMATION_SCHEMA.COLUMNS
    where COLUMN_NAME COLLATE utf8_general_ci = c;

install_spider.sql should be fixed using either of the ways.

Comment by Yuchen Pei [ 2023-05-23 ]

Closing because 10.1 was EOL and spider is no longer initialised using the install_spider.sql script

Generated at Thu Feb 08 07:28:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.