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

Fix for nvarchar(max) columns on sql 2005 #340

Merged
merged 1 commit into from Dec 30, 2015
Merged

Fix for nvarchar(max) columns on sql 2005 #340

merged 1 commit into from Dec 30, 2015

Conversation

cloudkite
Copy link
Contributor

When reading nvarchar max, ensure data is not falsey fixes nvarchar(max) columns on sql 2005

see #327

not sure why this doesn't fail on sql 2008+? Somehow data is never null even if db value is null?

fixes nvarchar(max) columns on sql 2005
@cloudkite
Copy link
Contributor Author

ping @arthurschreiber sorry ;)

@arthurschreiber
Copy link
Collaborator

arthurschreiber commented Nov 11, 2015 via email

@cloudkite
Copy link
Contributor Author

@arthurschreiber no problem, hope you have a great holiday.

If theres anything you need to help resolve or diagnose this let me know. Also just realised I forgot to attach the stacktrace

TypeError: Cannot read property 'toString' of null
    at /Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:399:18
    at /Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:406:14
    at /Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/token/stream-parser.js:405:9
    at Parser.awaitData (/Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/token/stream-parser.js:116:9)
    at Parser.readBuffer (/Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/token/stream-parser.js:402:12)
    at readMax (/Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:404:10)
    at readMaxNChars (/Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:398:3)
    at /Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:199:20
    at readDataLength (/Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:82:16)
    at /Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:94:5
    at readTextPointerNull (/Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:46:5)
    at exports.default (/Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:93:3)
    at next (/Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/token/row-token-parser.js:27:34)
    at /Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/token/row-token-parser.js:43:7
    at /Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:399:5
    at /Users/jonas/Projects/insight/node_modules/tedious-connection-pool/node_modules/tedious/lib/value-parser.js:448:5

@tswaters
Copy link

tswaters commented Dec 8, 2015

+1 we're getting this as well. In our case, it's xml columns that appear to be returning null.

TypeError: Cannot read property 'toString' of null,
    at /snip/tedious/lib/value-parser.js:399:18,
    at /snip/tedious/lib/value-parser.js:406:14,
    at /snip/tedious/lib/token/stream-parser.js:405:9,
    at Parser.awaitData (/snip/tedious/lib/token/stream-parser.js:116:9),
    at Parser.readBuffer (/snip/tedious/lib/token/stream-parser.js:402:12),
    at readMax (/snip/tedious/lib/value-parser.js:404:10),
    at readMaxNChars (/snip/tedious/lib/value-parser.js:398:3),
    at /snip/tedious/lib/value-parser.js:237:18,
    at readDataLength (/snip/tedious/lib/value-parser.js:86:14),
    at /snip/tedious/lib/value-parser.js:94:5,
    at readTextPointerNull (/snip/tedious/lib/value-parser.js:46:5),
    at exports.default (/snip/tedious/lib/value-parser.js:93:3),
    at next (/snip/tedious/lib/token/row-token-parser.js:27:34),
    at /snip/tedious/lib/token/row-token-parser.js:43:7,
    at /snip/tedious/lib/value-parser.js:399:5,
    at /snip/tedious/lib/value-parser.js:472:5

@dgasson
Copy link

dgasson commented Dec 23, 2015

+1, please! Same kind of problem. The suggested patch fixes the problem.

@arthurschreiber
Copy link
Collaborator

Hey all,

Thanks for all your input. I currently don't have access to my development machine, but I'll try to get this merged and push a new release before the end of the year.

Sorry for the delay and thanks for your patience!

arthurschreiber added a commit that referenced this pull request Dec 30, 2015
Fix for nvarchar(max) columns on sql 2005
@arthurschreiber arthurschreiber merged commit 6983924 into tediousjs:master Dec 30, 2015
@arthurschreiber
Copy link
Collaborator

Thank you! ❤️

@dgasson
Copy link

dgasson commented Dec 30, 2015

Excellent! Thank you muchly!

This was referenced Dec 30, 2015
@cloudkite
Copy link
Contributor Author

Thanks!! :)

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

Successfully merging this pull request may close these issues.

None yet

4 participants