sequeler icon indicating copy to clipboard operation
sequeler copied to clipboard

displaying dates

Open JO0st opened this issue 6 years ago • 11 comments

I have a database with a table in it that contains some fields of the type date. When issuing a query on that table the dates don't get displayed.

I attached screenshots from both sequeler and dbeaver issueing the same query to the same database.

image image

JO0st avatar Dec 29 '17 08:12 JO0st

Thanks for the report, that's definitely a bug! Would you be able to share with me the raw data? I don't need the entire table, just a couple of rows with the same data format, in order for me to test it locally. Cheers

Alecaddd avatar Dec 29 '17 17:12 Alecaddd

I attached a create table script with a table containing some of the problematic data test_data.sql.txt

JO0st avatar Jan 02 '18 08:01 JO0st

I pushed a new version to the AppCenter that should fix the problem, I'll test your data later today and see if it works. Thanks

Alecaddd avatar Jan 22 '18 00:01 Alecaddd

So, the problem happens because the field date has a set type of datetime, which the correct format is YYYY-MM-DD HH:MM:SS. You're saving just the date format YYYY-MM-DD, which is ok for the database itself, and the majority of the software out there. Unfortunately, Sequeler uses LibGda, which as you noticed it doesn't handle properly entries that don't exactly match the data type specified in the field. I'll look around and try to find a solution.

Alecaddd avatar Feb 20 '18 01:02 Alecaddd

Try to do a check

if (HH:MM:SS == null) {
    HH:MM:SS = 00:00:00
}

btd1337 avatar Feb 21 '18 20:02 btd1337

That's not how Vala or the LibGDA works, that check can't be done, and I shouldn't do if statements for specific conditions, the code won't be scalable.

Alecaddd avatar Feb 21 '18 20:02 Alecaddd

Just to confirm this is still a problem when using DATE field instead of DATETIME. In my case, it just displays the content of the previous column.

olivierberten avatar Jan 29 '19 21:01 olivierberten

It also displays the previous column for me: screenshot from 2019-02-02 14-25-23

nickelghost avatar Feb 02 '19 14:02 nickelghost

Same as @nickelghost Screenshot from 2019-05-06 17-52-17

mikeymop avatar May 06 '19 21:05 mikeymop

This bug is present in v0.7.0.( db connection: mariadb 10). Like the others have reported here, it's showing the previous columns value instead of the date field.

weop avatar Jul 08 '19 11:07 weop

This issue is still present as of 00e5f7b471.

In case it helps, this line is getting logged repeatedly:

(Sequeler:11902): GLib-GObject-WARNING **: 13:29:55.530: unable to set property 'text' of type 'gchararray' from value of type 'GDate'

gravyTrainee avatar Dec 08 '21 18:12 gravyTrainee