Problems caused by mysql version upgrade

Source: Internet
Author: User

Description of problems caused by mysql version upgrade: 1. java code of the mysql statement in ibatis <select id = "getQids" parameterClass = "int" resultClass = "hashMap"> SELECT d. qid, GROUP_CONCAT (epq. qid) qids FROM table1 d, table2 epq WHERE d. qid = # qid # AND d. pid = epq. pid group by d. checkPid LIMIT 1 </select> 2. service-Layer Code Java code Map <String, Object> tempMap = dao. getQids (qid); if (tempMap! = Null) {byte [] arr = (byte []) tempMap. get ("qids"); String tempQids = new String (arr); tempMap. put ("qids", tempQids); this. qids. add (tempMap);} 3. during the test on the test server, we found that the type conversion error was always reported for the red part of "2. N methods were adopted (1) local and svn code (2) Comparison Test and formal code (3) Comparison Test and formal data difference is not found (4) I began to suspect that the mysql Driver (5) mysql database version was eventually locked in the mysql database version because the database (Test Database) just adopted mysql 5.5 last month, and it was not officially released yet, the real reason is that mysql 5.1 is still used. The following reason: When you use group_concat, note that if the connected field is of the int type, you must convert it to char and then combine it, otherwise, after you execute the statement (ExecuteScalar or any other method that executes the SQL return result), the returned result will not be a comma-separated string, but byte []. This problem cannot be found in SQLyog or other tools. Select group_concat (ipaddress) from t_ip returns a comma-separated string select group_concat (id) from t_ip returns byte [] select group_concat (CAST (id as char )) from t_dep returns a comma-separated string select group_concat (Convert (id, char) from t_dep returns a comma-separated string.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.