Skip to content
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

New type error after fix #1085 #1089

Closed
lihombo opened this issue May 24, 2023 · 5 comments
Closed

New type error after fix #1085 #1089

lihombo opened this issue May 24, 2023 · 5 comments

Comments

@lihombo
Copy link

lihombo commented May 24, 2023

Information

  • Version of Medoo:2.1.9
  • Version of PHP:8.1
  • Type of Database (MySQL, MSSQL, SQLite...):MySQL
  • System (Liunx|Windows|Mac):Linux

Describe the Problem
For fix the issue #1085 ,make the field not defined will be converted to String type,like Int...which real need Int value and not String value, please make a default logic that will not be converted.

Detail Code
The detail code you are using causes the problem.

// Write your PHP code here

Expected output
A clear and concise description of what output you expected.

@scr4bble
Copy link

scr4bble commented Jun 9, 2023

We are having the same issue. I noticed some logic stopped working in our app because of changed types returned from medoo. I guess there will be many places now where this got broken.
We upgraded from 2.1.4 to 2.1.9 and the following code

$this->select('user_id', ['group_id' => $group_id, 'group_type' => $group_type]);

started returning array of strings instead of integers.
user_id is defined as int in our MySQL database.

If it was intended, please don't do such changes without using new major version.
Could you please look into it as soon as possible? I will downgrade the version back in the meantime.

@catfan
Copy link
Owner

catfan commented Jun 9, 2023

@hzbbcc @scr4bble I have fixed this issue on 802251e. Would you try that and see if the problem is resolved?

@scr4bble
Copy link

scr4bble commented Jun 9, 2023

Yes, it seems to work in 802251e (integers were returned from int MySQL column) - at least the one case that I mentioned above.
I had some difficulties trying a specific commit though so I hope I tested it correctly.
(had to add the repo into "repositories" in composer.json and use composer require catfan/medoo:dev-master#802251e)

@catfan
Copy link
Owner

catfan commented Jun 10, 2023

@scr4bble OK. The v2.1.10 version with this fix is released. https://github.com/catfan/Medoo/releases/tag/v2.1.10

@lihombo
Copy link
Author

lihombo commented Oct 25, 2023

@scr4bble OK. The v2.1.10 version with this fix is released. https://github.com/catfan/Medoo/releases/tag/v2.1.10

Thank you for your work!

@lihombo lihombo closed this as completed Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants