Bug #60144 | Pound symbol encrption and decryption problem | ||
---|---|---|---|
Submitted: | 16 Feb 2011 15:17 | Modified: | 29 Apr 2013 12:38 |
Reporter: | Vsetar Prajin | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / J | Severity: | S1 (Critical) |
Version: | 5.0.8 | OS: | Windows (XP) |
Assigned to: | Alexander Soklakov | CPU Architecture: | Any |
Tags: | charset, Pound symbol |
[16 Feb 2011 15:17]
Vsetar Prajin
[16 Feb 2011 16:51]
Valeriy Kravchuk
Are you sure this is a server problem, not a problem of your JDBC driver? Had you tried to repeat with recent versions of server (4.1.x is no longer supported anyway, so nobody is going to fix any bug in it) and MySQL Connector/J (5.1.7)?
[17 Feb 2011 5:57]
Vsetar Prajin
Tested in mhsql 5.0.36 also..Got wrong result only :(
[17 Feb 2011 7:32]
Valeriy Kravchuk
Had you used recent version of Connector/J, as I've suggested? If you had, please, add the following code to your test case: this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'chara%'"); while (this.rs.next()) { String name = this.rs.getString("Variable_name"); String val = this.rs.getString("Value"); System.out.println(name + ":\t" + val); } before executing your query, and send the output.
[17 Feb 2011 7:44]
Vsetar Prajin
Many thanks for your concern.. I don't know what is the connector version.Can you tel me how to find that? One more thing.I've edited my.ini file to use default charset as utf8. When I use " show variables like 'char%'" command in command line client,it shows all values for character_set_client,connection,results as utf8. So there is no issues with charset.
[17 Feb 2011 7:56]
Vsetar Prajin
Output of your test code : (character_Set_results doesn't show anything here but it displays 'utf8' when viewing through command line client) character_set_client: utf8 character_set_connection: utf8 character_set_database: utf8 character_set_results: character_set_server: utf8 character_set_system: utf8
[17 Feb 2011 8:05]
Valeriy Kravchuk
You can get the driver version details this way: DatabaseMetaData dbmd = conn.getMetaData(); System.out.println("getDriverVerision :" + dbmd.getDriverVersion()); System.out.println("getDriverMajorVerision :" + dbmd.getDriverMajorVersion()); System.out.println("getDriverMinorVerision :" + dbmd.getDriverMinorVersion()); System.out.println("getDriverName :" + dbmd.getDriverName()); Also, please, modify your test case to use the following select: select aes_decrypt(col1,'key1') as a, hex(aes_decrypt(col1,'key1')) as b from test and print values for columns a and b of the result, byte by byte, as you did.
[17 Feb 2011 9:49]
Vsetar Prajin
For 1st column,the result was 'val��' And the byte values were i : 0.. by[i] : 118 i : 1.. by[i] : 97 i : 2.. by[i] : 108 i : 3.. by[i] : -17 i : 4.. by[i] : -65 i : 5.. by[i] : -67 i : 6.. by[i] : -17 i : 7.. by[i] : -65 i : 8.. by[i] : -67 For 2nd column,the result was 76616CC2A3. And the byte values were i : 0.. by[i] : 55 i : 1.. by[i] : 54 i : 2.. by[i] : 54 i : 3.. by[i] : 49 i : 4.. by[i] : 54 i : 5.. by[i] : 67 i : 6.. by[i] : 67 i : 7.. by[i] : 50 i : 8.. by[i] : 65 i : 9.. by[i] : 51
[17 Feb 2011 14:04]
Vsetar Prajin
Tested with connector /J version 5.0.8 too..Issue still persists :( I used the below query to insert data. update test set col1 = aes_encrypt('"+value+"','key1'); where value is a string that contains £ symbol.
[18 Feb 2011 12:40]
Vsetar Prajin
Hello Kravchuk, Please help me out from this problem.This has been wasting my time for past 2 days.If this is a bug,then announce it here soon !
[1 Mar 2011 19:17]
Sveta Smirnova
Thank you for the feedback. Please provide output of SHOW CREATE TABLE test, insert into this table value aes_encrypt('£','key1') using your Java application (as you usually do it) and send us output of select hex(aes_encrypt('£','key1'));
[1 Mar 2011 19:18]
Sveta Smirnova
I am sorry, we need output of select hex(col1) from test for row where you inserted aes_encrypt('£','key1')
[1 Apr 2011 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[29 Apr 2013 12:38]
Alexander Soklakov
Hi Vsetar, There is no feedback since Mar 2011, so I close this report as "Can't repeat". Please, feel free to reopen it if the problem still exists with current driver version.