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

DB Update API doesn't work correctly when using floating-point types #3928

Closed
iliyan-velichkov opened this issue May 14, 2024 · 1 comment
Closed
Assignees
Projects

Comments

@iliyan-velichkov
Copy link
Contributor

iliyan-velichkov commented May 14, 2024

Example usage of the update API:

import { update } from "sdk/db";

const UPDATE_BY_CODE = "UPDATE `oc_order_total` SET `value` = ? WHERE (`order_id` = ? AND `code`=?)";

const orderId = 1;
const value = 13.13;
const code = 'total';
const params = [value, orderId, code];
update.execute(UPDATE_BY_CODE, params, 'ElectronicsStoreOpenCartDB');

Results in incorrect value 13, must be 13.13:
image

Most probably due to the following code

 parameterElement.getAsInt()

in here

image
image

@iliyan-velichkov
Copy link
Contributor Author

PR: #3929

@iliyan-velichkov iliyan-velichkov self-assigned this May 14, 2024
@iliyan-velichkov iliyan-velichkov added this to To do in Backlog via automation May 14, 2024
Backlog automation moved this from To do to Done May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant