Open jacekjaros opened 10 years ago
Jacek it's on Mysql or Postgres ?
I use postgres
i believe the error is caused by escaping 'hoursdiff' variable: query with escaping: bacula=# select * from "hoursstats" where "data" = '2014-04-08' and "server" = 'angel' and "bytes" = 6884397 and "starttime" = '14-04-07 23:05:01' and "endtime" = '2014-04-07 23:10:06' and "timediff" = '00:05:04' and "hoursdiff" = '0.0833333333333333' and "hourbytes" = 82612764 limit 1; ERROR: invalid input syntax for integer: "0.0833333333333333" LINE 1: ...06' and "timediff" = '00:05:04' and "hoursdiff" = '0.0833333...
query without escaping: ^ bacula=# select * from "hoursstats" where "data" = '2014-04-08' and "server" = 'angel' and "bytes" = 6884397 and "starttime" = '14-04-07 23:05:01' and "endtime" = '2014-04-07 23:10:06' and "timediff" = '00:05:04' and "hoursdiff" = 0.0833333333333333 and "hourbytes" = 82612764 limit 1; id | data | server | starttime | endtime | bytes | hoursdiff | hourbytes | timediff ----+------+--------+-----------+---------+-------+-----------+-----------+---------- (0 rows)
Facing the same error with PostgreSQL 8.3 As I'm not familiar with the frameworks used here: Is there a quick workaround?
php artisan BaculaStats:collect
[Illuminate\Database\QueryException] SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "0.0833333333333333" (SQL: select * from "hoursstats" where "data" = 2014-04-08 and "server" = angel and "bytes" = 6884397 and "starttime" = 20 14-04-07 23:05:01 and "endtime" = 2014-04-07 23:10:06 and "timediff" = 00:05:04 and "hoursdiff" = 0.0833333333333333 and "hourbytes" = 82612764 limit 1)