question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Numbers are being inconsistently returned

See original GitHub issue

Describe your system

  • odbc Package Version: 2.3.0
  • ODBC Driver: Microsoft Access Driver (*.mdb, *.accdb)
  • Database Name: Microsoft Access
  • Database Version: 2002-2003
  • Database OS: Windows 10
  • Node.js Version: 12.18.0
  • Node.js OS: Windows 10

Describe the bug Numbers are being inconsistently returned from Access database. For example, 0 is sometimes returned as 0.04. In the Access database, it’s 0.

Expected behavior Data should consistently be returned. I did not have this problem in version 1.4.6.

To Reproduce

Add an ODBC x64 Microsoft Access datasource called “odbc-number-issue”

Driver: https://www.microsoft.com/en-us/download/details.aspx?id=13255

Checkout and build the example repo

This repo contains the Access database and examples of how the query returns inconsistent data.

Repo: https://github.com/bennyt2/odbc-number-issue

npm install npm run build npm start

Running the program will attempt to execute the offending query 100 times. I usually get between 0-5 hits from this, but I’ve seen over 200 in a single run. It’s random. It may take a couple runs to see a console log that looks like this:

Event_no 128 should have Event_dist 1500, but Event_dist is 1500.02

In this example, if you look at Event_no 128 in the Event table, you will see Event_dist is 1500.

I’m sure this is some kind of minor data type issue, but the inconsistency is causing problems.

Additional context

  • I know this DB format is very old, but I don’t have the option of upgrading.
  • I was not able to get the DEBUG output working in binding.gyp. I followed these steps but saw nothing in my terminal: ** Change line 16 from 'NAPI_EXPERIMENTAL' to 'NAPI_EXPERIMENTAL', 'DEBUG ** cd node_modules/odbc && npm install ** cd ../../ && npm run r

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
markdirishcommented, Jul 28, 2020

Better waiting for 2.3.2. I will try to push it out today!

1reaction
nedi-devcommented, Jul 28, 2020

Had some trouble with installing using your install command because of using password for ssh public key. Following command worked for me:

npm install git+ssh://git@github.com:markdirish/node-odbc#issue96-inconsistent-numbers

My tests work fine now. I’ll ask my colleague to test it with his examples. Getting back shortly with the results.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: inconsistent value type when returning results fro...
As for my if/switch logic that undesirably passes numbers as strings into the Sort functions, I'll just be concatenating leading 0s to said ......
Read more >
Inconsistent return types from numericInput #3738 - GitHub
The return type from numericInput should be "numeric". However, it seems like it's either an integer or a numeric, depending on what number...
Read more >
Inconsistent return types from python functions – Really?
I spent some time thinking about why python "allows" inconsistent return types and realized it is not just python, but pretty much any...
Read more >
Inconsistent number of results returned from ... - Google Groups
I submit 12,031 keywords to the TargetingIdeaService · On one run I get 143,644 results returned (12 months of data per keyword) ·...
Read more >
Inconsistent rounding in 1099-B - TurboTax Support
I understand numbers can be rounded but the IRS says that either you round all the numbers or none of them. My problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found