'topic_last_post_subject' sql error on upgrade to 3.04

Temporary forum to obtain support while phpBB.com is offline.
Please use the support forum on phpBB.com
Forum rules
Temporary forum to obtain support while phpBB.com is offline.
Please use the support forum on phpBB.com
Locked
smackhq
Registered User
Posts: 5
Joined: Thu Feb 05, 2009 6:11 am

'topic_last_post_subject' sql error on upgrade to 3.04

Post by smackhq »

Your board's URL: http://www.glasply.net/phpbb3/index.php
Version of phpBB3: 3.04 (at least that's what system says)
Was this a fresh install or a(n) update/upgrade/conversion (please be specific)? update
If update, what package(s) did you use? auto
Did you use an automated wizard provided by your host to install phpBB?
MODs you have installed: photo album
When the problem started: after updating from 3.01 to 3.04
Your level of expertise (be honest): Low

Additionally, you may wish to provide the following (where applicable)
Template(s) used: subsilver2
Language(s) used: english
Version of PHP used:
Database and version used:
Test account*:

*A test account (username/password) may be helpful if team members need to view a page hidden to guests.php dba's I need some help.

I thought the upgrade from my 3.01 to 3.04 would be easy. I thought I followed every step and made full backups the entire way but now I'm unable to post anything on site and get the following SQL error.

Field 'topic_last_post_subject' doesn't have a default value [1364]

I noticed someone else posted on this and I followed those steps to fix the db schema but no luck so far.
If anyone can assist I would be very grateful.

Here is the entire error after you submit a new post:
SQL ERROR [ mysql4 ]
Field 'topic_last_post_subject' doesn't have a default value [1364]

SQL

INSERT INTO phpbb3_topics (topic_poster, topic_time, forum_id, icon_id, topic_approved, topic_title, topic_first_poster_name, topic_first_poster_colour, topic_type, topic_time_limit, topic_attachment) VALUES (2, 1233814166, 13, 0, 1, 'test', 'Rob', 'AA0000', 0, 0, 0)

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: includes/functions_posting.php
LINE: 1850
CALL: dbal_mysql->sql_query()

FILE: posting.php
LINE: 1001
CALL: submit_post()

User avatar
rahber
Former Team Member
Posts: 14
Joined: Mon Feb 02, 2009 10:08 am
Contact:

Re: 'topic_last_post_subject' sql error on upgrade to 3.04

Post by rahber »

I guess it will be usefull for you
Doesn't have a default value errors
lost in area 51 :o

smackhq
Registered User
Posts: 5
Joined: Thu Feb 05, 2009 6:11 am

Re: 'topic_last_post_subject' sql error on upgrade to 3.04

Post by smackhq »

Thanks but I found that link earlier and tried the fix. No good.
Any other suggestions?

ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: 'topic_last_post_subject' sql error on upgrade to 3.04

Post by ToonArmy »

You actually ran the queries the script produced?
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

fornit
Registered User
Posts: 9
Joined: Wed Feb 04, 2009 5:12 pm

Re: 'topic_last_post_subject' sql error on upgrade to 3.04

Post by fornit »

Hi,

obviously it's missing the default value on that column. You can set that as follows:

Code: Select all

ALTER TABLE `phpbb_topics` ALTER `topic_last_post_subject` SET DEFAULT '';
For reasons of security, please backup phpbb_topics first.

Regards

smackhq
Registered User
Posts: 5
Joined: Thu Feb 05, 2009 6:11 am

Re: 'topic_last_post_subject' sql error on upgrade to 3.04

Post by smackhq »

Hope your right. I will give it a try and reply later.
Thanks for assistance.
Rob

smackhq
Registered User
Posts: 5
Joined: Thu Feb 05, 2009 6:11 am

Re: 'topic_last_post_subject' sql error on upgrade to 3.04

Post by smackhq »

Doesn't look like that works...I wish I knew more about db to help.

Error
SQL query:
ALTER TABLE `phpbb3_topics` ALTER `topic_last_post_subject` SET DEFAULT ''
MySQL said: Documentation
#1101 - BLOB/TEXT column 'topic_last_post_subject' can't have a default value

fornit
Registered User
Posts: 9
Joined: Wed Feb 04, 2009 5:12 pm

Re: 'topic_last_post_subject' sql error on upgrade to 3.04

Post by fornit »

That error usually comes up if you try to set a default for a field which has the type "text", "mediumtext" or so.

In my installation (3.0.4) that fied (i.e. topic_last_post_subject) has the type varchar(255). What's the field type in your table?

You can see that in phpmyadmin.

Regards

XuluWarrior
Registered User
Posts: 1
Joined: Tue Feb 10, 2009 9:16 am

Re: 'topic_last_post_subject' sql error on upgrade to 3.04

Post by XuluWarrior »

I too am getting this problem. I notice that the schema scripts in the install kit use VARCHAR(255) with a default '' for MySQL 4.1 but BLOB NOT NULL for 4.0. This would explain why some people are getting this and others not. However, I don't know why the difference is there in the first place. And I don't know whether the problem is caused by a change to the schema or a change to the code.

Locked