Ошибка Row size too large?

Всё работало до добавления новых полей GRAPH1_graph_colors...GRAPH4_graph_colors.
Возможно я превысил какое то ограничение?

PHP код
mysql_query("INSERT INTO `user_settings` (`user_id`,`last_access_time`,`crypto_graph2_token`,`GRAPH1_active_stock_button`,`GRAPH2_active_stock_button`,`GRAPH3_active_stock_button`,`GRAPH4_active_stock_button`,`GRAPH1_graph_scale`,`GRAPH2_graph_scale`,`GRAPH3_graph_scale`,`GRAPH4_graph_scale`,`GRAPH1_show`,`GRAPH2_show`,`GRAPH3_show`,`GRAPH4_show`,`GRAPH1_show_cryptocurrency_on_graph`,`GRAPH2_show_cryptocurrency_on_graph`,`GRAPH3_show_cryptocurrency_on_graph`,`GRAPH4_show_cryptocurrency_on_graph`,`GRAPH1_show_graph_date_begin`,`GRAPH2_show_graph_date_begin`,`GRAPH3_show_graph_date_begin`,`GRAPH4_show_graph_date_begin`,`GRAPH1_show_graph_date_end`,`GRAPH2_show_graph_date_end`,`GRAPH3_show_graph_date_end`,`GRAPH4_show_graph_date_end`,`GRAPH1_graph_colors`,`GRAPH2_graph_colors`,`GRAPH3_graph_colors`,`GRAPH4_graph_colors`,`GRAPH_active_tab`,`GRAPH_autoupdate`,`GRAPH_one_for_all_graph_slider`,`GRAPH_theme`) VALUES 
('$user_id','$last_access_time','$crypto_graph2_token','bittt','bittt','bittt','bittt','number','number','number','number','0','0','0','0','','','','','$show_graph_date_begin','$show_graph_date_begin','$show_graph_date_begin','$show_graph_date_begin','$show_graph_date_end','$show_graph_date_end','$show_graph_date_end','$show_graph_date_end','','','','','1','off','on','default')") or die(mysql_error());


Ошибка
Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.

Таблица
CREATE TABLE `user_settings` (
`id` int(11) NOT NULL,
`user_id` char(255) NOT NULL,
`last_access_time` int(11) NOT NULL,
`crypto_graph2_token` char(255) NOT NULL,
`GRAPH1_active_stock_button` char(255) NOT NULL,
`GRAPH2_active_stock_button` char(255) NOT NULL,
`GRAPH3_active_stock_button` char(255) NOT NULL,
`GRAPH4_active_stock_button` char(255) NOT NULL,
`GRAPH1_graph_scale` char(255) NOT NULL,
`GRAPH2_graph_scale` char(255) NOT NULL,
`GRAPH3_graph_scale` char(255) NOT NULL,
`GRAPH4_graph_scale` char(255) NOT NULL,
`GRAPH1_show` char(255) NOT NULL,
`GRAPH2_show` char(255) NOT NULL,
`GRAPH3_show` char(255) NOT NULL,
`GRAPH4_show` char(255) NOT NULL,
`GRAPH1_show_cryptocurrency_on_graph` char(255) NOT NULL,
`GRAPH2_show_cryptocurrency_on_graph` char(255) NOT NULL,
`GRAPH3_show_cryptocurrency_on_graph` char(255) NOT NULL,
`GRAPH4_show_cryptocurrency_on_graph` char(255) NOT NULL,
`GRAPH1_show_graph_date_begin` char(255) NOT NULL,
`GRAPH2_show_graph_date_begin` char(255) NOT NULL,
`GRAPH3_show_graph_date_begin` char(255) NOT NULL,
`GRAPH4_show_graph_date_begin` char(255) NOT NULL,
`GRAPH1_show_graph_date_end` char(255) NOT NULL,
`GRAPH2_show_graph_date_end` char(255) NOT NULL,
`GRAPH3_show_graph_date_end` char(255) NOT NULL,
`GRAPH4_show_graph_date_end` char(255) NOT NULL,
`GRAPH1_graph_colors` char(255) NOT NULL,
`GRAPH2_graph_colors` char(255) NOT NULL,
`GRAPH3_graph_colors` char(255) NOT NULL,
`GRAPH4_graph_colors` char(255) NOT NULL,
`GRAPH_active_tab`  char(255) NOT NULL,
`GRAPH_autoupdate`  char(255) NOT NULL,
`GRAPH_one_for_all_graph_slider`  char(255) NOT NULL,
`GRAPH_theme` char(255) NOT NULL

);
ALTER TABLE `user_settings` ADD PRIMARY KEY (`id`);
  
ALTER TABLE `user_settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;


Вопрос - на что жалуется php/mysql ?Что ему не нравится?
PS
Уменьшение char(255) на char(5) поможет/влияет на память/быстродействие/производительность?
  • Вопрос задан
  • 79 просмотров
Решения вопроса 1
@remzalp
Программер чего попало на чем попало
Длина всей строки получается:
id=4+last_access_time=4+34x255=8 678 байт.
упёрлись в технические ограничения.

Можно вылечить как советуют
ALTER TABLE `user_settings` ROW_FORMAT=DYNAMIC;

Ключевой вопрос - А ВАМ НАДО СТОЛЬКО ХРАНИТЬ ОДНОЙ ТАБЛИЦЕЙ?
Исходя из чего выбиралась такая длина данных?
varchar может быть использовать?
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы