Modify

Opened 6 years ago

Closed 6 years ago

#3290 closed enhancement (fixed)

Added compatibly with MysSQL

Reported by: anderson@… Owned by: rharkins
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@… 6 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 6 years ago by anderson@…

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

comment:1 Changed 6 years ago by anonymous

  • Type changed from defect to enhancement

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 6 years ago by anonymous

  • Owner changed from rharkins to anonymous
  • Status changed from new to assigned

comment:3 Changed 6 years ago by anonymous

  • Keywords tracforms-0.2 added
  • Priority changed from normal to high
  • Severity changed from normal to major

comment:4 Changed 6 years ago by rharkins

  • Owner changed from anonymous to rharkins
  • Status changed from assigned to new

comment:5 Changed 6 years ago by rharkins

  • Status changed from new to assigned

comment:6 Changed 6 years ago by rharkins

  • Keywords tracforms-0.2.1 added; tracforms-0.2 removed

comment:7 Changed 6 years ago by rharkins

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 6 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 6 years ago by rharkins

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 6 years ago by anonymous

  • Resolution set to fixed
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Action
as closed The owner will remain rharkins.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.