The problem is not the table name length, since there actually is code that tests this and truncates the name if it exceeds 64 characters.
The issue arises when there is an accumulation of tables that have already have had their names extended, the code retries ten times to append an underscore, each time finding an old table with that number appended undersocres.
This was the result I got starting with a table with a a name of exactly 64 characters:
It ran correctly 10 times, each time truncating and then appending an underscore. At the tenth run it failed because it assumes something weird is going on when it can't find a viable name after ten variations.
The debug output Agustin posted is indeed wrong in that it always says "Try 1 of 10" , when it should be incrementing "2 of 10", "3 of 10" etc. That should be corrected but it's not a serious problem.
So the question might be, is it reasonable for the tool to fail after 10 tries in this scenario?
Or maybe, should the tool create a quasi-unique random identifier, such as "4G6N8O_test" ?
The problem is not the table name length, since there actually is code that tests this and truncates the name if it exceeds 64 characters.
The issue arises when there is an accumulation of tables that have already have had their names extended, the code retries ten times to append an underscore, each time finding an old table with that number appended undersocres.
This was the result I got starting with a table with a a name of exactly 64 characters:
show tables: ___test12345678 901234567890123 456789012345678 901234567890 __test123456789 012345678901234 567890123456789 012345678901 _test1234567890 123456789012345 678901234567890 123456789012 test12345678901 234567890123456 789012345678901 234567890123 678901234567890 123456789012345 678901234567890 1234 789012345678901 234567890123456 789012345678901 2345 890123456789012 345678901234567 890123456789012 3456 901234567890123 456789012345678 901234567890123 4567 012345678901234 567890123456789 012345678901234 5678 123456789012345 678901234567890 123456789012345 6789 234567890123456 789012345678901 234567890123456 7890
_______
_______
_______
_______
______test12345
_____test123456
____test1234567
___test12345678
__test123456789
_test1234567890
test12345678901
It ran correctly 10 times, each time truncating and then appending an underscore. At the tenth run it failed because it assumes something weird is going on when it can't find a viable name after ten variations.
The debug output Agustin posted is indeed wrong in that it always says "Try 1 of 10" , when it should be incrementing "2 of 10", "3 of 10" etc. That should be corrected but it's not a serious problem.
So the question might be, is it reasonable for the tool to fail after 10 tries in this scenario?
Or maybe, should the tool create a quasi-unique random identifier, such as "4G6N8O_test" ?