New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hex converter giving invalid results #15136
Comments
|
@williamdes, this was the one |
|
@williamdes I was looking into this issue and found that the issue is not with PMA code, rather this is a issue with mysql itself. mysql give different output of HEX() when passed string('70') or int(70) whereas OCT() give same output for int and string. |
|
Nice lead @apoorvkhare07👍. But shouldn't the input field take it as an int since my column type is int |
Signed-off-by: apoorv <apoorvkhare007@gmail.com>
|
@williamdes, I wanted to work on this. But if we treat the integer as String we have a very special benefit. Consider the number 4: If we treat this as '4' instead it would be converted to hex in the following format: Similarly, the 'answer' for "44" is 3434. So what is the benefit: In this way, we can treat an int as a string and then convert it back to int, doing the required type castings or conversions. I am sharing the link for trial if needed: How to solve this problem? |
@thesmallstar Yes, I think the best Idea is that I can see your proposal to better understand it What bout #15147 ? |
|
@williamdes , have a look at this When we implement the PR, unexpected behaviour is shown, since now Alphabets are also returned by the function. I don't think it is needed, only a note for the user will do regarding what he is trying to do. On which branch do I need to proceed? |
|
I understand, thank you for the example |
|
@thesmallstar I agree with you. I opened the issue because I felt I was not able to understand the behavior of the function and there should be a quick note regarding what you mentioned. |
Signed-off-by: William Desportes <williamdes@wdes.fr>


Describe the bug
The hexadecimal converter 'HEX' in the insert field is giving invalid results. Suppose if I enter 70 as my int value it should give answer as '46' in HEX but it is giving answer as '3730'.
The 'OCT' converter for the same is working correct as I verified.
To Reproduce
Expected behaviour
The 'HEX' function should give out the corrected value.
Screenshots
This value '3730' was received from type conversion of int '70' to hex
Server configuration
Operating system: macOS Server(5.7.1 )
Web server: Apache/2.4.37 (Unix) OpenSSL/1.0.2q PHP/7.3.0 mod_perl/2.0.8-dev Perl/v5.16.3
Database version: Localhost via UNIX socket
PHP version: 7.3.0
phpMyAdmin version: 4.8.4
Client configuration
Browser: Safari (12.0.3)
Operating system: macOS Mojave (version 10.14.2)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: