Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to delete more than 30 rows (50/100) at one time @ Exception Reporter (500 Internal Server Error) #7

Open
NickCoolii opened this issue Mar 5, 2019 · 1 comment

Comments

@NickCoolii
Copy link

NickCoolii commented Mar 5, 2019

@z-song hi!

Laravel admin 1.5.19

Reason is:
Data too long for column 'path' @ table admin_operation_log (at my DB field path is varchar(255))

As I can see possible workarounds:

  1. Bad: change at table schema varchar to text
  2. Better: truncate path variable
  3. The best: put ids from path to input attribute (send ids not as $_GET param, but as $_POST)

Full SQL error:

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'path' at row 1 
(SQL: insert into `admin_operation_log` (`user_id`, `path`, `method`, `ip`, `input`, `updated_at`, `created_at`) values 
(1, admin/exceptions/391,390,389,388,387,386,385,384,383,382,381,380,379,378,377,376,375,374,373,372,371,370,369,368,367,366,365,364,363,362,361,360,359,358,357,356,355,354,353,352,351,350,349,348,347,346,345,344,343,342,341,340,319,318,317,316,315,314,313,31, DELETE, 127.0.0.1, {"_method":"delete","_token":"MkNXt6V30KhIlPHfwSOt1Sxr1GLSeb9crLUoSmFu"}, 2019-03-05 17:40:22, 2019-03-05 17:40:22))

UPD: at my production DB path was VARCHAR(191), but when I changed its length to 255, than DELETE request for big number of rows started to work and just truncate row to 255 characters (path field).
path.admin_operation_log at DB for 100 entries looks like:
admin/exceptions/867,866,865,864,863,862,861,860,859,858,857,856,855,854,853,852,851,850,849,848,847,846,845,844,843,842,841,840,839,838,837,836,835,834,833,832,831,830,829,828,827,826,825,824,823,822,821,820,819,818,817,816,815,814,813,812,811,810,809,80

This much better, than just nothing. Dunno about such effects of varchar's length.

@z-song
Copy link
Member

z-song commented Mar 6, 2019

Please feel free to send a pr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants