Warning: The author of this contribution does not provide support for it anymore.

Profile Views List

General Error - Profile Views List

General Error

by nean » Sat Jul 23, 2011 12:23 am

Code: Select all

Index name 'phpbb1_profile_views_profile_user_id' on table 'phpbb1_profile_views' is too long. The maximum is 24 characters.


I got this error, is there anyway to shorten the index name ??
nean
Registered User
Posts: 4
Joined: Fri Jul 22, 2011 7:05 am
Contact:

Re: General Error

by lefty74 » Sat Jul 23, 2011 10:07 am

hi, that must have been an addition to 3.0.9. I will have to still check this and all my other mods for compatibility.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: General Error

by nean » Wed Jul 27, 2011 6:51 am

Thanks for the support, and does the mod support 3.0.8 ?? so that i can roll back to older version to get your cool mod enabled :D
nean
Registered User
Posts: 4
Joined: Fri Jul 22, 2011 7:05 am
Contact:

Re: General Error

by lefty74 » Fri Jul 29, 2011 6:34 pm

hi, yes, it works on 3.0.8 but I wouldn't recommend to go back in versions to be honest as there are normally good reasons why a new version is out ;)
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: General Error

by SimpleRpg » Sun Aug 07, 2011 2:10 am

So, how do i fix this?
SimpleRpg
Registered User
Posts: 1
Joined: Sun Aug 07, 2011 2:08 am
Contact:

Re: General Error

by lefty74 » Sun Aug 07, 2011 3:17 pm

i am afraid you will have to wait until i have had time to change the table and field lengths and update the install file.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: General Error

by Cyber_Punk » Fri Aug 26, 2011 11:06 pm

lefty74 wrote:i am afraid you will have to wait until i have had time to change the table and field lengths and update the install file.


Any guess on how long that would take would really like to use this mod :?
Cyber_Punk
Registered User
Posts: 7
Joined: Wed Jan 20, 2010 1:07 am
Contact:

Re: General Error

by lefty74 » Sat Aug 27, 2011 1:41 pm

no idea how long, if you really want to use that mod, you could change in includes/db/db_tools.php

line 1414, change 30 to 130 = if (strlen($column_name) > 130)
line 2060, change 24 to 124 = if (strlen($table_name . $index_name) - strlen($table_prefix) > 124)
line 2097, change 24 to 124 = if (strlen($table_name . $index_name) - strlen($table_prefix) > 124)

then run the install file

make sure after the install file ran to change these values back to their original numbers.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: General Error

by VOLKERMORD » Sun Aug 28, 2011 9:43 am

lefty74 wrote:no idea how long, if you really want to use that mod, you could change in includes/db/db_tools.php

line 1414, change 30 to 130 = if (strlen($column_name) > 130)
line 2060, change 24 to 124 = if (strlen($table_name . $index_name) - strlen($table_prefix) > 124)
line 2097, change 24 to 124 = if (strlen($table_name . $index_name) - strlen($table_prefix) > 124)

then run the install file

make sure after the install file ran to change these values back to their original numbers.

Thx it work
Har tios tintoninos insus tiko is dakon kand sia til kogaion ilmaton hlioylo pleiste naktoilo
User avatar
VOLKERMORD
Registered User
Posts: 111
Joined: Thu Jul 23, 2009 1:20 pm
Location: Dacia (Wolf land)
Contact:

Re: General Error

by doktornotor » Tue Sep 20, 2011 7:37 am

Cyber_Punk wrote:
lefty74 wrote:i am afraid you will have to wait until i have had time to change the table and field lengths and update the install file.


Any guess on how long that would take would really like to use this mod :?


Considering this stupidity is caused by dbal (phpBB code) and not the mod, you would be a whole lot better off taking this with the phpBB guys. This was a change in 3.0.9 - allegedly to "accommodate other DB engines" and is pure crap.

When you write your MOD so that you have, e.g.,

Code:

Code: Select all

Table Name: phpbb_foobarmod_foobar_baz
Index Name: idx_foo


then until 3.0.9 you have an index calledidx_foo created.

Result:

Code: Select all

Table Name: phpbb_foobarmod_foobar_baz
Index Name: idx_foo


With 3.0.9, it is "improved" so that dbal creates the following clusterfsck instead:

Code:

Code: Select all

Table Name: phpbb_foobarmod_foobar_baz
Index Name: idx_foo


Result:

Code: Select all

Table Name: phpbb_foobarmod_foobar_baz
Index Name: phpbb_foobarmod_foobar_baz_idx_foo


So, the "magic" has "fixed"/"Improved" something that was not broken, created something the author has not intended in the first place (the index named phpbb_foobarmod_foobar_baz_idx_foo) and then bombs out on its own screw-up when it hits the "compatibility" restriction. Well done! :roll:

Apparently they want to force people to use much "better" and more "descriptive" table names such as phpbb_fbm_fb_b instead of phpbb_foobarmod_foobar_baz

PHPBB3-9892 is the ticket that produces this junk. Firebird, uh... :roll: You might want to comment there - except that you cannot, because

Not a member? Contact an {0}Administrator{1} to request an account.


I failed to find Mr. {0}Administrator{1}; Atlassian JIRA, wow. :roll:

P.S. Multiple mods are affected by this phpBB misdesign.
Support requests via PM go straight to /dev/null!
User avatar
doktornotor
Registered User
Posts: 608
Joined: Fri Sep 09, 2011 7:41 am

Re: General Error

by doktornotor » Tue Sep 20, 2011 8:15 am

lefty74 wrote:no idea how long, if you really want to use that mod, you could change in includes/db/db_tools.php

line 1414, change 30 to 130 = if (strlen($column_name) > 130)
line 2060, change 24 to 124 = if (strlen($table_name . $index_name) - strlen($table_prefix) > 124)
line 2097, change 24 to 124 = if (strlen($table_name . $index_name) - strlen($table_prefix) > 124)

then run the install file

make sure after the install file ran to change these values back to their original numbers.


In addition to that (and no need to revert these changes since it is not supposed to be like that in the first place):

In includes/db/dbtools.php

Find on line 2062:

Code: Select all

      $max_length = $table_prefix + 24;


Replace with

Code: Select all

      $max_length = strlen($table_prefix) + 24;


Find on line 2099:

Code: Select all

      $max_length = $table_prefix + 24;


Replace with:

Code: Select all

      $max_length = strlen($table_prefix) + 24;

Reference.

Otherwise, if you do not plan on migrating to fscked-up DBs like Firebird in future, the max values for MySQL are:

5.1 - UTF-8 index length of 333 (3 bytes per character)
6.0 - UTF-8 index length of 250 (4 bytes per character)

which corresponds to overall max key length of 1000 bytes -- yeah, "thanks" to MySQL/Oracle folks - MySQL Bug #4541 has 7+ years and counting!

So, for the edits suggested by lefty74, those are just fine to leave there as well for MySQL.
Support requests via PM go straight to /dev/null!
User avatar
doktornotor
Registered User
Posts: 608
Joined: Fri Sep 09, 2011 7:41 am

Re: General Error

by Boardtalk.net » Sat Feb 04, 2012 11:53 pm

lefty74 wrote:no idea how long, if you really want to use that mod, you could change in includes/db/db_tools.php

line 1414, change 30 to 130 = if (strlen($column_name) > 130)
line 2060, change 24 to 124 = if (strlen($table_name . $index_name) - strlen($table_prefix) > 124)
line 2097, change 24 to 124 = if (strlen($table_name . $index_name) - strlen($table_prefix) > 124)

then run the install file

make sure after the install file ran to change these values back to their original numbers.

This worked thanks ;)
User avatar
Boardtalk.net
Registered User
Posts: 1209
Joined: Fri Jun 05, 2009 8:12 pm
Location: Ireland
Name: Colette
Contact: