artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible MySQL Bug


From: Jaft
Subject: Re: Possible MySQL Bug
Date: Thu, 29 Oct 2020 01:39:04 +0000 (UTC)

Nala writes:

> I think what you're looking for is make-table-modifier, however, the
> delete operation is missing somehow, I may forgot to add it.

Oh, cool; adding to an already existing make-table- function makes this a lot easier.

> The modifications in mysql/postgresql/sqlite3 are different, so we have
> to take care of them.

They are? Granted, I haven't done a lot of extensive SQL but I thought they all followed the basic

DELETE FROM <table_name>
WHERE       <condition>;

> The FPRM is still experimental and not well tested yet, but I encourage
> you to report any exceptions.

Funnily enough, – not directly in the fprm.scm file but used by it – I noticed in ssql.scm that both the last option for both sql-update and sql-delete call ->where with the WHERE portions being run through sql-where before being sent to ->where (lines 173 and 186).

But ->where uses sql-where in both possible cases so you end up basically sending a string to sql-where in ->where. I think line 173 is supposed to be

(->where end (sql-update table set pairs) rest ...)

and line 186

(->where end (sql-delete from table) rest ...)

If I'm correct, would you want me to create a PR to correct those? Or just roll those fixes into the PR for deleting rows in FPRM?



Finally, should I fork from master and make the PR to there or use another branch? My assumption is master but just thought I should double check.

Jonathan

On Wednesday, October 28, 2020, 12:35:47 PM CDT, Nala Ginrut <mulei@gnu.org> wrote:



Hi Jaft!

Jaft writes:

> Unrelated, I looking to delete some rows from a table with FPRM but (if I've read the source code correctly) it looks like such functionality doesn't currently exist. I was thinking to try putting together a pull-request to help but ran into a few inquiries.
> It didn't seem to make sense to add the functionality to make-table-dropper since that function seems more about dropping or deleting tables, specifically (rather than rows); likewise for make-table-modifier, since it seemed more about modifying the structure of tables, rather than the data contained in tables. Not make-table-getter, for obvious reasons, and, while make-table-setter seemed the most similar, setting data isn't quite the same as deleting it.
> So, I figured, just make a new function called make-table-deleter but it seemed like a lot of the inner functions – or, at least, the logic employed – for such a function would be similar to and have a lot of overlap with make-table-setter, creating some redundancy.
> Heh, so I figured I'd inquire here; would it be helpful for me to try putting together a PR, any? Or were you holding off on implementing this functionality (in which case, not a good idea for a PR)? And, if otherwise, is there any preferred way or direction you'd want for the code of such a PR to be handled?
> Jonathan

I think what you're looking for is make-table-modifier, however, the
delete operation is missing somehow, I may forgot to add it. So a PR is
welcome.
The modifications in mysql/postgresql/sqlite3 are different, so we have
to take care of them. Please follow the similar pattern of the
definition inside make-table-modifier.

The FPRM is still experimental and not well tested yet, but I encourage
you to report any exceptions.

BTW, you don't have to create a modifer with this contructor, the preferred way
is to create a table mapping with (map-table-from-DB rc/conn), and pass
'mod as the first argument for calling modifier.


Best regards.

--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058


reply via email to

[Prev in Thread] Current Thread [Next in Thread]