Alecaddd / sequeler

SQL Client built in Vala
GNU General Public License v3.0
800 stars 66 forks source link

displaying dates #66

Open JO0st opened 6 years ago

JO0st commented 6 years ago

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

Alecaddd commented 6 years ago

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

JO0st commented 6 years ago

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

Alecaddd commented 6 years ago

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 commented 6 years ago

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.

btd1337 commented 6 years ago

Try to do a check

if (HH:MM:SS == null) {
    HH:MM:SS = 00:00:00
}
Alecaddd commented 6 years ago

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.

olivierberten commented 5 years ago

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.

nickelghost commented 5 years ago

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

mikeymop commented 5 years ago

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

weop commented 5 years ago

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.

gravyTrainee commented 2 years ago

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'