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

Laravel push queue fail #33

Open
holyblue opened this issue Aug 5, 2016 · 7 comments
Open

Laravel push queue fail #33

holyblue opened this issue Aug 5, 2016 · 7 comments

Comments

@holyblue
Copy link

holyblue commented Aug 5, 2016

I used the laravel function to push a database queue and got some error below.
Error Code : 1438
Error Message : ORA-01438: value larger than specified precision allowed for this column
Position : 109
Statement : insert into jobs ("queue", attempts, reserved, reserved_at, available_at, created_at, payload) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6) returning id into :p7
Bindings : [default,0,0,,1470367614,1470367614,{"job":"Illuminate\Queue\CallQueuedHandler@call","data":{"commandName":"LendingFront\Jobs\SendSmsJob","command":"O:28:"LendingFront\Jobs\SendSmsJob":4:{s:10:"connection";N;s:5:"queue";N;s:5:"delay";N;s:6:"\u0000*\u0000job";N;}"}},0]

I find the error is occur in "Yajra\Pdo\Oci8\Statement" "bindParam" function,
when case PDO::PARAM_INT the bind value is not the current value.

123

The second record is the after bind value and the first record is the correct value.

I change the $ociType To SQLT_CHR then every thing is correct.
case PDO::PARAM_INT:
$ociType = SQLT_CHR;
break;
I don't know this is the bug or some thing else. Could you help me ?

@yajra
Copy link
Owner

yajra commented Aug 5, 2016

@holyblue what version are you using? This issue was already fixed in the framework v5.2. See this issue yajra/laravel-oci8#170

@holyblue
Copy link
Author

holyblue commented Aug 5, 2016

I think it's not the same problem.
my env lsit:
database: oracle 12c
Laravel Framework version 5.2.39
"Yajra/laravel-oci8": "^5.2",
PHP Version 7.0.4RC1
oci8
OCI8 Support enabled
OCI8 DTrace Support disabled
OCI8 Version 2.1.0
Revision $Id: 86f22a208f89dcd5b305e82929a7429683968b11 $
Oracle Run-time Client Library Version 12.1.0.2.0
Oracle Compile-time Instant Client Version 12.1

@plip14
Copy link

plip14 commented Jan 18, 2017

I'm encountering the same problem.

Error Code : 1438
Error Message : ORA-01438: value larger than specified precision allowed for this column
Using v5.2.13 - 2016-10-12

the field is a NUM(2). I try to insert integer 1, and it gave me that error.
Same solution.

On vendor\yajra\laravel-oci8\src\Oci8\Query\Processors\OracleProcessor.php
Line 102 :  if (is_int($value)) {
            return PDO::PARAM_INT;
        }

Change to return PDO::PARAM_STR;

and everything works.

@yajra
Copy link
Owner

yajra commented Jan 19, 2017

@plip14 can you please submit a PR for your proposed solution? Does your solution did not affect other crud operations on your app? Maybe we can indeed remove the int check. We'll also try this when I had the chance. Thanks!

@plip14
Copy link

plip14 commented Jan 19, 2017

I'm converting from another framework to laravel, but I'm still quite early on my app, so far basic CRU is ok. We only do soft delete though.

@YohanYsturiz
Copy link

Funciono, tenia el mismo inconveniente, modifique el parámetro return PDO::PARAM_INT; por PARAM_STR y almaceno ahora verificare que no este afectando el funcionamiento de mi CRUD

@YohanYsturiz
Copy link

Quisiera saber porque ocurre ese error?

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

4 participants