[
http://mifosforge.jira.com/browse/MIFOS-3589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61950#action_61950
]
jbrewster commented on MIFOS-3589:
----------------------------------
this was email from Buddy on 11/11/2010:
Hi,
On CI head-master build (8085), when a string with a few double byte characters
(eg., "عربية") is used as 'title' to create a question, the app crashes with
the following error in the tomcat logs:
Caused by: java.sql.SQLException: Illegal mix of collations
(latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3563)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3495)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2693)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2102)
at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2261)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1849)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.doList(Loader.java:2294)
However, the same scenario works happily on my local machine (Ubuntu 10.10,
MySQL 5.1.49-1ubuntu8). The question is properly created inside the 'Questions'
table.
After a little more analysis, I figured out that this is a (some kind of) table
collation issue. So, I ran the following query on both of our databases with
these result:
Query: select table_schema, table_collation from information_schema.tables
where table_name = 'questions';
Result on CI:
+-----------------------------------+-------------------+
| table_schema | table_collation |
+-----------------------------------+-------------------+
| hudson_mifos_gazelle_trunk | latin1_swedish_ci |
+-----------------------------------+-------------------+
Result on my local box:
+--------------+-------------------+
| table_schema | table_collation |
+--------------+-------------------+
| mifos | utf8_general_ci |
+--------------+-------------------+
For some reason, the table 'Questions' is created with two different
collations. Apparently, the one with the collation, utf8_general_ci works
properly for this scenario.
Here's the 'Questions' table definition from latest latest-schema.sql:
create table questions (
question_id integer auto_increment not null,
answer_type integer not null,
question_state integer not null,
question_text varchar(1000) not null,
numeric_min integer,
numeric_max integer,
nickname varchar(64) not null,
primary key(question_id),
unique(nickname)
) engine=innodb character set utf8;
Note that, in the above definition, only the charset is specified (utf8 in this
case) and not the collation. When collation isn't specified, MySql defaults to
the collation corresponding to the specified charset which in this case is
utf8_general_ci. However, for some reason this did not happen on CI.
So, yesterday I executed the following DDL locally on the CI database to fix
the collation on the 'Questions' table:
ALTER TABLE questions CHARACTER SET utf8 COLLATE utf8_general_ci;
That fixed the collation for this table as the subsequent result of the earlier
query confirmed:
+-----------------------------------+-------------------+
| table_schema | table_collation |
+-----------------------------------+-------------------+
| hudson_mifos_gazelle_trunk | utf8_general_ci |
+-----------------------------------+-------------------+
Unfortunately, this did not fix the double byte char issue on CI. The failure
still happens with the exact exception as observed before (I tried it after
restarting 8085 as well).
> Exception when creating question with double byte characters
> ------------------------------------------------------------
>
> Key: MIFOS-3589
> URL: http://mifosforge.jira.com/browse/MIFOS-3589
> Project: mifos
> Issue Type: Bug
> Components: Surveys/PPI
> Affects Versions: Release E
> Environment: http://ci.mifos.org:8085/mifos
> Reporter: jbrewster
> Assignee: Kalyan Akella
> Priority: Major
> Fix For: Release E - Iteration 11, Release E
>
> Attachments: screenshot-1.jpg
>
> Original Estimate: 1 day
> Remaining Estimate: 1 day
>
> Add question form crashes when creating a question that includes double byte
> chars in the Question Title.
> Repro steps:
> 1. login to test server: http://ci.mifos.org:8085/mifos
> 2. go to admin->add questions
> 3. enter question title with double byte chars - e.g. arabic: "عربية"
> 4. click add question
> expected result: get new question created
> actual result: error - see attached screenshot
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues