Index: app/controllers/wiki_controller.rb
===================================================================
--- app/controllers/wiki_controller.rb	(revision 1506)
+++ app/controllers/wiki_controller.rb	(working copy)
@@ -73,10 +73,13 @@
       @content.attributes = params[:content]
       @content.author = User.current
       # if page is new @page.save will also save content, but not if page isn't a new record
-      if (@page.new_record? ? @page.save : @content.save)
+      if (@page.new_record? ? @page.save! : @content.save!)
         redirect_to :action => 'index', :id => @project, :page => @page.title
       end
     end
+  rescue ActiveRecord::StatementInvalid
+    # Content too long for database
+    flash[:error] = l(:text_wiki_content_too_large)
   rescue ActiveRecord::StaleObjectError
     # Optimistic locking exception
     flash[:error] = l(:notice_locking_conflict)
Index: db/migrate/095_alter_wiki_content_text_size.rb
===================================================================
--- db/migrate/095_alter_wiki_content_text_size.rb	(revision 0)
+++ db/migrate/095_alter_wiki_content_text_size.rb	(revision 0)
@@ -0,0 +1,11 @@
+class AlterWikiContentTextSize < ActiveRecord::Migration
+  def self.up
+    change_column :wiki_contents, :text, :text, :limit => 64.kilobytes * 2
+    change_column :wiki_content_versions, :data, :binary, :limit => 64.kilobytes * 2
+  end
+
+  def self.down
+    change_column :wiki_content_versions, :data, :binary
+    change_column :wiki_contents, :text, :text
+  end
+end
Index: lang/bg.yml
===================================================================
--- lang/bg.yml	(revision 1506)
+++ lang/bg.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
\ No newline at end of file
Index: lang/cs.yml
===================================================================
--- lang/cs.yml	(revision 1506)
+++ lang/cs.yml	(working copy)
@@ -628,3 +628,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/da.yml
===================================================================
--- lang/da.yml	(revision 1506)
+++ lang/da.yml	(working copy)
@@ -625,3 +625,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/de.yml
===================================================================
--- lang/de.yml	(revision 1506)
+++ lang/de.yml	(working copy)
@@ -624,3 +624,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/en.yml
===================================================================
--- lang/en.yml	(revision 1506)
+++ lang/en.yml	(working copy)
@@ -598,6 +598,7 @@
 text_assign_time_entries_to_project: Assign reported hours to the project
 text_reassign_time_entries: 'Reassign reported hours to this issue:'
 text_user_wrote: '%s wrote:'
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
 
 default_role_manager: Manager
 default_role_developper: Developer
Index: lang/es.yml
===================================================================
--- lang/es.yml	(revision 1506)
+++ lang/es.yml	(working copy)
@@ -626,3 +626,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/fi.yml
===================================================================
--- lang/fi.yml	(revision 1506)
+++ lang/fi.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/fr.yml
===================================================================
--- lang/fr.yml	(revision 1506)
+++ lang/fr.yml	(working copy)
@@ -597,7 +597,8 @@
 text_destroy_time_entries: Supprimer les heures
 text_assign_time_entries_to_project: Reporter les heures sur le projet
 text_reassign_time_entries: 'Reporter les heures sur cette demande:'
-text_user_wrote: '%s a écrit:'
+text_user_wrote: '%s a écrit
+text_wiki_content_too_large: Le contenu de cette page de wiki est trop grand. Merci de le réduire.
 
 default_role_manager: Manager
 default_role_developper: Développeur
Index: lang/he.yml
===================================================================
--- lang/he.yml	(revision 1506)
+++ lang/he.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/hu.yml
===================================================================
--- lang/hu.yml	(revision 1506)
+++ lang/hu.yml	(working copy)
@@ -624,3 +624,5 @@
 mail_subject_reminder: "%d feladat határidős az elkövetkező napokban"
 text_user_wrote: '%s írta:'
 label_duplicated_by: duplikálta
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
+
Index: lang/it.yml
===================================================================
--- lang/it.yml	(revision 1506)
+++ lang/it.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/ja.yml
===================================================================
--- lang/ja.yml	(revision 1506)
+++ lang/ja.yml	(working copy)
@@ -624,3 +624,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/ko.yml
===================================================================
--- lang/ko.yml	(revision 1506)
+++ lang/ko.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/lt.yml
===================================================================
--- lang/lt.yml	(revision 1506)
+++ lang/lt.yml	(working copy)
@@ -625,3 +625,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/nl.yml
===================================================================
--- lang/nl.yml	(revision 1506)
+++ lang/nl.yml	(working copy)
@@ -624,3 +624,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/no.yml
===================================================================
--- lang/no.yml	(revision 1506)
+++ lang/no.yml	(working copy)
@@ -598,6 +598,7 @@
 text_assign_time_entries_to_project: Overfør førte timer til prosjektet
 text_reassign_time_entries: 'Overfør førte timer til denne saken:'
 text_user_wrote: '%s skrev:'
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
 
 default_role_manager: Leder
 default_role_developper: Utvikler
Index: lang/pl.yml
===================================================================
--- lang/pl.yml	(revision 1506)
+++ lang/pl.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/pt-br.yml
===================================================================
--- lang/pt-br.yml	(revision 1506)
+++ lang/pt-br.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/pt.yml
===================================================================
--- lang/pt.yml	(revision 1506)
+++ lang/pt.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/ro.yml
===================================================================
--- lang/ro.yml	(revision 1506)
+++ lang/ro.yml	(working copy)
@@ -623,3 +623,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/ru.yml
===================================================================
--- lang/ru.yml	(revision 1506)
+++ lang/ru.yml	(working copy)
@@ -627,3 +627,4 @@
 mail_subject_reminder: "%d назначенных на вас задач в ближайшие дни" 
 text_user_wrote: '%s написал:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/sr.yml
===================================================================
--- lang/sr.yml	(revision 1506)
+++ lang/sr.yml	(working copy)
@@ -624,3 +624,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/sv.yml
===================================================================
--- lang/sv.yml	(revision 1506)
+++ lang/sv.yml	(working copy)
@@ -624,3 +624,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/th.yml
===================================================================
--- lang/th.yml	(revision 1506)
+++ lang/th.yml	(working copy)
@@ -626,3 +626,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/uk.yml
===================================================================
--- lang/uk.yml	(revision 1506)
+++ lang/uk.yml	(working copy)
@@ -625,3 +625,4 @@
 mail_subject_reminder: "%d issue(s) due in the next days"
 text_user_wrote: '%s wrote:'
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/zh-tw.yml
===================================================================
--- lang/zh-tw.yml	(revision 1506)
+++ lang/zh-tw.yml	(working copy)
@@ -624,3 +624,4 @@
 enumeration_issue_priorities: 項目優先權
 enumeration_doc_categories: 文件分類
 enumeration_activities: 活動 (時間追蹤)
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/zh.yml
===================================================================
--- lang/zh.yml	(revision 1506)
+++ lang/zh.yml	(working copy)
@@ -624,3 +624,4 @@
 enumeration_doc_categories: 文档类别
 enumeration_activities: 活动（时间跟踪）
 label_duplicated_by: duplicated by
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: test/unit/wiki_content_test.rb
===================================================================
--- test/unit/wiki_content_test.rb	(revision 1506)
+++ test/unit/wiki_content_test.rb	(working copy)
@@ -40,6 +40,16 @@
     assert_equal User.find(1), content.author
     assert_equal content.text, content.versions.last.text
   end
+  
+  def test_very_big_create
+    page = WikiPage.new(:wiki => @wiki, :title => "Big big page")
+    big_text = "X" * 1024 * 64
+    bt_l = big_text.length
+    puts "text length: #{bt_l}"
+    page.content = WikiContent.new(:text => big_text, :author => User.find(1), :comments => "Eat that, MySQL")
+    page.save
+    assert_equal bt_l, WikiPage.find(page.id).content.text.length, "Wiki content lost!" 
+  end
 
   def test_update
     content = @page.content
