bitcoin-abe / bitcoin-abe

Abe: block browser for Bitcoin and similar currencies
GNU Affero General Public License v3.0
982 stars 653 forks source link

Column length too big 'txout_scriptPubKey' #96

Open bsom opened 10 years ago

bsom commented 10 years ago

The following error occurs when trying to create a new database:

_mysql_exceptions.OperationalError: (1074, "Column length too big for column 'txout_scriptPubKey' (max = 65535); use BLOB or TEXT instead")

Appears to be a problem with line 90 in DataStore.py: MAX_SCRIPT = 1000000

The comment before this line indicates that this number is the number of bytes for the script column, but the database appears interpret this as the raw length in characters.

lunde commented 10 years ago

got the same problem

edit: just changed MAX_SCRIPT to 65000 (line 92 in DataStore.py) as a temp. workaround. I don't know if this has any negative effects. The blocks are parsing to my DB now.

ZeroXn commented 9 years ago

is this still the recommended solution? Im trying to get abe working on windows, using pymysql

JRizzly commented 7 years ago

If you are working with a version of MySQL of 5.7.5 or greater then they made "STRICT_TRANS_TABLES" a default setting in the config file. So you have a couple options,

  1. download older version
  2. set you global and session variables to not use that: ``` "set session sql_mode = 'NO_ENGINE_SUBSTITUTION';"

Then check by "show variables;"


Will fix the problem. 
dermoth commented 7 years ago

I think the proper fix would be setting up the column to use MEDIUMBLOB, as suggested by the error message (MEDIUMBLOB supports up to 16MiB values and costs one more byte over BLOB which is limited to 64k like VARBINARY).

In the mean time removing the STRICT_TRANS_TABLES mode will issue a warning and create the column as MEDIUMBLOB.

Namecoin is known to fail loading due to the scriptPubKey limit with MAX_SCRIPT=10000 (the old default); AFAIK as long as blocks are loading fine there is no drawbacks of running with a smaller column size, except one day it may fail and you may have to alter your table with a longer scriptPubKey (Better do it early while the table is smaller).

tamizharasank commented 7 years ago

where this document datastore.py