Modify

Opened 9 years ago

Closed 9 years ago

#3290 closed enhancement (fixed)

Added compatibly with MysSQL

Reported by: anderson@… Owned by: Rich Harkins
Priority: high Component: TracFormsPlugin
Severity: major Keywords: tracforms-0.2.1
Cc: Trac Release: 0.11

Description

Some changes on form_db.py to work with MySQL.

Please put this modifications on the new version.

Attachments (1)

formdb.py (11.2 KB) - added by anderson@… 9 years ago.
The creation SQL scripts of this file were modified to work witk MySQL databases.

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by anderson@…

Attachment: formdb.py added

The creation SQL scripts of this file were modified to work witk MySQL databases.

comment:1 Changed 9 years ago by anonymous

Type: defectenhancement

Thanks for the attachment on this. It may take a little bit for that to work its way in as I'll need to make sure that the plugin works with the default Trac database (sqlite3) as well as MySQL ultimately. I'll take a look at what may need to happen to make it work both ways.

Because of this, I'm switching the status to enhancement. If I can't find a quick solution then for the time being I'm also going to provide a reference to this ticket on the front page of the plugin with instructions on how to install it on 0.1/0.2. I think I've got an idea that may work but I'll have to see how it goes and will have to set up a test environment for it since I usually just use the default Trac db.

Thanks!

comment:2 Changed 9 years ago by anonymous

Owner: changed from Rich Harkins to anonymous
Status: newassigned

comment:3 Changed 9 years ago by anonymous

Keywords: tracforms-0.2 added
Priority: normalhigh
Severity: normalmajor

comment:4 Changed 9 years ago by Rich Harkins

Owner: changed from anonymous to Rich Harkins
Status: assignednew

comment:5 Changed 9 years ago by Rich Harkins

Status: newassigned

comment:6 Changed 9 years ago by Rich Harkins

Keywords: tracforms-0.2.1 added; tracforms-0.2 removed

comment:7 Changed 9 years ago by Rich Harkins

Check out r3928 (it's under the branches/tracforms-0.2 since it's under development) and let me know if this works out for you. It worked on my test environment for both sqlite and mysql.

I did make some tweaks to the schema, mainly in the form of VARCHAR lengths. As I understand it, MySQL really treats VARCHAR(1) through VARCHAR(127) pretty much the same in terms of space, etc. VARCHAR(128) through VARCHAR(255) are different on some older versions due to the sign bit.

So, I moved context to VARCHAR(255) since these are often URLs and I could imagine cases where the URL would be truncated at 100. The other fields I moved to 127 out of paranoia.

If there are strong reasons to keep these smaller, let me know. Either way, please try out the changes and note whether they work for you.

Thanks again!

comment:8 Changed 9 years ago by anderson@…

Worked fine.

But, occurred an error just on an new form (I think this would be in an new ticket but i preferred to put here cause i don´t know if is correlated yet):

get_last_id() takes at least 3 arguments (1 given)

When the form is already created and used everything works great. I´ve used the "Laundry list example" in trackforms wiki.

Thank you too for the feedback and concerns.

comment:9 Changed 9 years ago by Rich Harkins

Ooops! Thanks for pointing that out. I've adjusted it and committed the change to the 0.2 branch (although I can't test it very thoroughly until later).

/me grumbles about postgreSQL's lack of a canonical last_insert_id facility...

comment:10 Changed 9 years ago by anonymous

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Rich Harkins.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.