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

Error on NVARCHAR columns #8

Closed
GoogleCodeExporter opened this issue Jun 15, 2015 · 2 comments
Closed

Error on NVARCHAR columns #8

GoogleCodeExporter opened this issue Jun 15, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

To duplicate add the following test in []typeTest:

{"select cast('' as nvarchar(5))", match("")}

The stack trace should be:
        panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x432ba8]

goroutine 3 [running]:
testing.func┬╖004()
        E:/Go/GoTip/src/pkg/testing/testing.go:348 +0xd0
code.google.com/p/odbc.(*BaseColumn).Value(0xc080098560, 0xc08007dba0, 0x0, 0xc,
 0x1, ...)
        E:/Go/GoExternal/src/code.google.com/p/odbc/column.go:118 +0x7e8
code.google.com/p/odbc.(*BindableColumn).Value(0xc080099540, 0x2b7fb0, 0x0, 0xc0
8007dbb0, 0x41a1bd, ...)
        E:/Go/GoExternal/src/code.google.com/p/odbc/column.go:223 +0x336
code.google.com/p/odbc.(*Rows).Next(0xc080090a28, 0xc08007dbc0, 0x1, 0x1, 0x1, .
..)


I investigated the issue and found that buf(len) is 0 in the case of 
api.SQL_C_WCHAR.  Additionally, in func (c *BindableColumn) Value(...), c.Len 
is 0 but c.Size is 12.  I think c.Size is 12 because 5 unicode characters (10 
bytes) + 1 unicode termination character.  However, why is the length 0?

Original issue reported on code.google.com by lukemaul...@gmail.com on 20 May 2013 at 7:48

@GoogleCodeExporter
Copy link
Author

How about this change https://codereview.appspot.com/9473047/ ?

Alex

Original comment by alex.bra...@gmail.com on 21 May 2013 at 12:59

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision d6c8ba201097.

Original comment by alex.bra...@gmail.com on 21 May 2013 at 11:21

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant