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

Go 1.3 will require you to change (*C.OCIServer)(s.c.svc) to (*C.OCISvcCtx)(s.c.svc) #27

Closed
andlabs opened this issue Jun 4, 2014 · 9 comments

Comments

@andlabs
Copy link

andlabs commented Jun 4, 2014

In Go 1.2 and earlier, any C struct that is only declared, never defined, and used only via pointers ("sealed") was turned into [0]byte. This meant that mismatched struct types went undetected. Go 1.3 gets rid of this behavior, making each declared struct type unique.

Your code has, in several places, lines of the form

    rv := C.OCIStmtExecute(
        (*C.OCIServer)(s.c.svc),

However, according to the docs, the first parameter to OCIStmtExecute() must be a OCISvcCtx. So the code will need to be changed to

    rv := C.OCIStmtExecute(
        (*C.OCISvcCtx)(s.c.svc),

to compile in Go 1.3.

This was discovered while trying to get this package working for @RGidron on his Mavericks setup on Gopher Academy's Slack server; after working with him for a bit I found this error (I was familiar with this misbehavior when it broke my ui package when it tried to use Cairo types).

@andlabs andlabs changed the title Go 1.3 will require you to change (*C.OCIServer)(tx.c.svc) to (*C.OCISvcCtx)(tx.c.svc) Go 1.3 will require you to change (*C.OCIServer)(s.c.svc) to (*C.OCISvcCtx)(s.c.svc) Jun 4, 2014
@mattn
Copy link
Owner

mattn commented Jun 5, 2014

Currently, I don't have Oracle environment. Could you please send me a pull-request?

@peterhellberg
Copy link

I’m having the same issue when building on 1.3

@mattn mattn closed this as completed in ed4a5c2 Jun 19, 2014
@mattn
Copy link
Owner

mattn commented Jun 19, 2014

OK, I merged this. But I did't make sure this change is working. Sorry.

mattn added a commit that referenced this issue Jun 19, 2014
@mattn
Copy link
Owner

mattn commented Jun 19, 2014

@peterhellberg Ah, sorry, I notice you are making PR.

@peterhellberg
Copy link

@mattn No problem :)

@peterhellberg
Copy link

@mattn You mistyped OCISvcCtx though! 🙅

mattn added a commit that referenced this issue Jun 19, 2014
@mattn
Copy link
Owner

mattn commented Jun 19, 2014

Oooops. Could you please check last comit?

@peterhellberg
Copy link

@mattn Yes, it now compiles under both OS X and Linux (Ubuntu)

I’m using the latest versions of the Instant Client for both platforms (11.2 and 12.1 respectively)

@mattn
Copy link
Owner

mattn commented Jun 19, 2014

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

No branches or pull requests

3 participants