Modify

Opened 2 years ago

Last modified 2 years ago

#10384 new defect

Properly cast `authenticated` field for subscription_attribute table

Reported by: rea Owned by: doki_pen
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: hasienda, scottso@…, bas Trac Release: 0.12

Description (last modified by rjollos)

authenticated is an integer in SQL schema, so it should be properly cast: for example, PostgreSQL is picky about this.

Attachments (1)

patch-announcer-model-authenticated-typecasts (3.9 KB) - added by rea 2 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 2 years ago by rjollos

  • Cc hasienda added; anonymous removed

This patch looks correct to me. authenticated is an INT in the database schema (t:TracDev/DatabaseSchema) and is a bool in the Session class, where it is cast to int before writing to the database.

comment:2 Changed 2 years ago by rjollos

  • Description modified (diff)
  • Summary changed from Properly cast "authenticated" field for subscription_attribute table to Properly cast `authenticated` field for subscription_attribute table

comment:3 Changed 2 years ago by rjollos

  • Cc scottso@… bas added

#10191 closed as a duplicate. This ticket was kept open since it has a patch. #10191 will be useful for confirming that the same traceback is seen when reproducing the issue.

comment:4 Changed 2 years ago by rjollos

#9247 closed as a duplicate.

comment:5 Changed 2 years ago by bas

bas: Are you also running PostgreSQL?

Yes

comment:6 Changed 2 years ago by anonymous

See also #8065

comment:7 Changed 2 years ago by rjollos

#8065 closed as a duplicate, and it has a patch which we may want to review.

comment:8 Changed 2 years ago by hasienda

(In [12302]) TracAnnouncer: Part 7 of 7 - Finally: Go from present to future, refs #5774, #7975, #8065, #9742 and #10384.

Now we've bridged the gap and provide an upgrade path for each historic schema revision of this plugin, while data migration is incomplete yet, especially regarding subscription attributes stored in session_attribute (before v3). Due to component name changes the conversion will be rather complicated, and therefore corresponding research and development is postponed to a future date and will largely depend on explicite demand as well.

comment:9 Changed 2 years ago by hasienda

(In [12303]) TracAnnouncer: Convert type to match db table definitions, refs #7975, #8065 and #10384.

These changes are based on work by olistudent, Stephen Anderson and rea. I made sure, that we respect PEP8 as well, at least as far as Trac core does.

Thanks to all of you for testing, reports and suggestions towards a portable fix, and - ultimately - patience to get it finally resolved.

Add Comment

Modify Ticket

Action
as new The owner will remain doki_pen.
Author


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

 
Note: See TracTickets for help on using tickets.