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

Server crash with a simple dataset #57

Closed
pascalr0410 opened this issue Aug 10, 2023 · 5 comments
Closed

Server crash with a simple dataset #57

pascalr0410 opened this issue Aug 10, 2023 · 5 comments

Comments

@pascalr0410
Copy link

pascalr0410 commented Aug 10, 2023

Hello
I'm experiencing a server crash with a small dataset :

[2023-08-10T15:56:04Z INFO  sqlpage::webserver::database] Connecting to database: mysql://root@127.0.0.1/sandbox
[2023-08-10T15:56:04Z INFO  sqlpage::webserver::database] Applying migrations from 'sqlpage/migrations'
[2023-08-10T15:56:04Z INFO  sqlpage::webserver::database] Found 1 migrations:
[2023-08-10T15:56:04Z INFO  sqlpage::webserver::database]       [0001] Simple create users table
[2023-08-10T15:56:04Z INFO  sqlpage] Starting server on 0.0.0.0:8081
[2023-08-10T15:56:04Z INFO  actix_server::builder] starting 6 workers
[2023-08-10T15:56:04Z INFO  actix_server::server] Actix runtime found; starting in Actix runtime
thread 'actix-rt|system:0|arbiter:0' panicked at 'range end index 8 out of range for slice of length 5', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\byteorder-1.4.3\src\lib.rs:2199:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Running V0.9.4 under Windows 10

SQL of the page :

SELECT 
    'chart' as component,
    'Nb Fact' as title,
    'bar' as type,
    1 as stacked;

select * from test2;

And the Test2 table is below, the value field is stored in DECIMAL in the database, other fields are stored in VARCHAR

"series";"x";"value"
"Foo";"2021-01";"13324"
"Bar";"2021-01";"4096"
"Foo";"2021-02";"4845"
"Bar";"2021-02";"3782"
"Bar";"2021-03";"4036"
"Foo";"2021-03";"11861"
"Bar";"2021-04";"3694"
"Foo";"2021-04";"11338"
"Bar";"2021-05";"3866"
"Foo";"2021-05";"11736"
"Foo";"2021-06";"11337"
"Bar";"2021-06";"3746"
"Foo";"2021-07";"11694"
"Bar";"2021-07";"3925"
"Foo";"2021-08";"13205"
"Bar";"2021-08";"4692"
"Bar";"2021-09";"3732"
"Foo";"2021-09";"11406"
"Bar";"2021-10";"3929"
"Foo";"2021-10";"11839"
"Bar";"2021-11";"3832"
"Foo";"2021-11";"11575"
"Bar";"2021-12";"4513"
"Foo";"2021-12";"17555"
"Foo";"2022-01";"20807"
"Bar";"2022-01";"4039"
"Foo";"2022-02";"22293"
"Bar";"2022-02";"4692"
"Foo";"2022-03";"6393"
"Bar";"2022-03";"4148"
"Bar";"2022-04";"4740"
"Foo";"2022-04";"10067"
"Bar";"2022-05";"4194"
"Foo";"2022-05";"6949"
"Bar";"2022-06";"4778"
"Foo";"2022-06";"7926"
"Foo";"2022-07";"14581"
"Bar";"2022-07";"4196"
"Foo";"2022-08";"8311"
"Bar";"2022-08";"4893"
"Foo";"2022-09";"11218"
"Bar";"2022-09";"4366"
"Foo";"2022-10";"12579"
"Bar";"2022-10";"4627"
"Foo";"2022-11";"12442"
"Bar";"2022-11";"4130"
"Bar";"2022-12";"9372"
"Foo";"2022-12";"12837"
"Bar";"2023-01";"4628"
"Foo";"2023-01";"9429"
"Foo";"2023-02";"12681"
"Bar";"2023-02";"4679"
"Foo";"2023-03";"9516"
"Bar";"2023-03";"4222"
"Foo";"2023-04";"10936"
"Bar";"2023-04";"4487"
"Bar";"2023-05";"4138"
"Foo";"2023-05";"11280"
"Bar";"2023-06";"4474"
"Foo";"2023-06";"10561"
"Foo";"2023-07";"4363"
"Bar";"2023-07";"1124"
"Foo";"2023-08";"1"

regards,
Pascal

@lovasoa
Copy link
Collaborator

lovasoa commented Aug 10, 2023

Hello, and thank you for the bug report.

It looks like the problem comes from decoding decimal values. Can you reproduce it with a simple select CAST(1 AS DECIMAL); ?

@lovasoa
Copy link
Collaborator

lovasoa commented Aug 10, 2023

Can you paste the full backtrace you get by reproducing the crash with environment variable RUST_BACKTRACE=1 ?

@lovasoa
Copy link
Collaborator

lovasoa commented Aug 10, 2023

Ok, I found the bug in the mysql driver. I'm pushing a fix, it'll be in the next version.

@lovasoa
Copy link
Collaborator

lovasoa commented Aug 10, 2023

Until the next version is published, you can work around the bug by casting decimal values before passing them to SQLPage:

select series, x, 
    CAST(value AS DOUBLE) AS value
from test2;

@pascalr0410
Copy link
Author

Got it, your bypass work well !

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

2 participants