jmueller17 / Aixada

Aixada helps self-managed consumption cooperatives to organize their flow of products, money, and information.
Other
33 stars 37 forks source link

Error 1406 (data too long for column 'products') on get_member_info call #226

Closed davidromani closed 5 years ago

davidromani commented 6 years ago

Al acceder a la ruta /manage_mysettings.php me aparece el siguiente error:

CALL get_member_info('2','0') generated error 1406: Data too long for column 'products' at row 27

Existe alguna manera de alterar alguna tabla (o columna) para solucionarlo?

jorix commented 6 years ago

Existe alguna manera de alterar alguna tabla (o columna) para solucionarlo?

Sí, como parche provisional esto funcionará y no se pierde nada relevante:

delimiter |
drop function if exists get_products_of_member|
create function get_products_of_member(the_member_id int)
returns varchar(255)
begin
  declare products varchar(255);
  return '';
end|

Este procedimiento UNICAMENTE se usa para mostrar la lista truncada de los productos de los que es responsable la UF del miembro. Dejará de mostrarse esta información de la cuenta: imagen

jorix commented 6 years ago

Pero voy a investigar más...
Primero ver sí está relacionado con el uso de character_set_database=latin1 (pensando en #224). Yo me inclino a que sí, pero por ahora no he montado el entorno para probarlo.

davidromani commented 6 years ago

@jorix ya he alterado toda la BD para canviar a UTF8 y su colación correspondiente. También he ejecutado SQLs para convertir el contenido existente en todas las tablas.

Lo puedes ver aquí:

Server version: 5.7.22-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like "character_set_database";
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| character_set_database | utf8  |
+------------------------+-------+
1 row in set (0.00 sec)

mysql> show variables like "collation_database";
+--------------------+-----------------+
| Variable_name      | Value           |
+--------------------+-----------------+
| collation_database | utf8_general_ci |
+--------------------+-----------------+
1 row in set (0.00 sec)
jorix commented 6 years ago

Y habeis ejecutado otra vez aixada_queries_all.sql?

Es importante hacerlo.

El dl., 30 abr. 2018 15.55, David Romaní notifications@github.com va escriure:

@jorix https://github.com/jorix ya he alterado toda la BD para canviar a UTF8 y su colación correspondiente. También he ejecutado SQLs para convertir el contenido existente en todas las tablas.

Lo puedes ver aquí:

Server version: 5.7.22-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like "character_set_database";+------------------------+-------+ | Variable_name | Value |+------------------------+-------+ | character_set_database | utf8 |+------------------------+-------+1 row in set (0.00 sec)

mysql> show variables like "collation_database";+--------------------+-----------------+ | Variable_name | Value |+--------------------+-----------------+ | collation_database | utf8_general_ci |+--------------------+-----------------+1 row in set (0.00 sec)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jmueller17/Aixada/issues/226#issuecomment-385405166, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDGDlZdaqASkYToY3VUo0W8rv7uHQtpks5ttxftgaJpZM4TsaF_ .

davidromani commented 6 years ago

Sí, también lo he hecho.

jorix commented 6 years ago

Ok, pues partiré de ahí cuando me ponga hacer pruebas.

El dl., 30 abr. 2018 16.12, David Romaní notifications@github.com va escriure:

Sí, también lo he hecho.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jmueller17/Aixada/issues/226#issuecomment-385410125, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDGDiUbLcHkQIgaMpQa0N02v9nzcwKjks5ttxvpgaJpZM4TsaF_ .

davidromani commented 6 years ago

Hola, perdona que insista @jorix

Has podido solucionar algo de este tema?