Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Database error
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2023-04-18 19:41:50
When I try to create a poll it gives a "database error". In the SQL log it shows...

Database Error in admincp.php on line 1654: Data truncated for column 'sort' at row 1. Query was: INSERT INTO polls VALUES(0, '2023-04-18 19:37:35', 'my question', 'yes', 'no', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0).
Last edited by dranivil on 2023-04-18 19:42:04
2023-04-18 22:48:10
what i see it isbeacause you SQL database it is not on A_I

2023-04-18 22:48:21
make sure mysql strict mode is turned off it should be NO_ENGINE_SUBSTITUTION, run the check file, I updated it to include a sql mode check
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2023-04-18 22:49:52
2023-04-19 05:28:48
Quote:

NO_ENGINE_SUBSTITUTION is a MySQL configuration option that controls what happens when the specified database engine for a table is unavailable or disabled.

When NO_ENGINE_SUBSTITUTION is enabled (default setting), if the specified database engine for a table is unavailable or disabled, MySQL will substitute the default engine specified in the configuration file, which is usually InnoDB.

If NO_ENGINE_SUBSTITUTION is disabled, and the specified engine is unavailable or disabled, MySQL will return an error message and will not create the table.

It is important to note that while NO_ENGINE_SUBSTITUTION can be useful in certain cases, it is generally not recommended to disable it, as it can cause unexpected behavior and potentially compromise data integrity.


I dont know why you guys have so many problems on this. I switched to MariaDB over 2 years ago and its been amazing ever since. InnoDB across all tables, you can convert them easily to InnoDB or any other storage engine using a good client like HeidiSQL.

If fact if you just use HeidiSQL, you can easily change all of this no problem and problem solve these problems right away.

And reviewing the mysql error log is really important otherwise you have no idea what is going on and why.
2023-04-19 10:36:33
by default, if I remember correctly, there are several modes set, like no engine substitution, no zero in date, etc, yo just want it to one be set at no engine subs.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2023-04-19 15:47:00
I just dont know why I am not relying on this at all as we run the similar platform technically, kind of. less and lesser these days but still holds TT inside in places. So I cant figure out why this is required.

Is it to import the SQL file? Is it to write to tables? Can you not write to tables without NO_ENGINE_SUBSTITUTION?

Maybe this is a MyISAM thing. I feel so outside of the fence lmao
Last edited by STorrents2020 on 2023-04-19 15:48:27
2023-04-19 21:29:16
I think its more the no zero date thing honestly, but I did null the datetime in TTv3, but some other things may still have an issue, I cant remember, I just know it was just good practice to set you whole DB to no engine substitution only with no other things
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2023-04-19 21:30:41
2023-04-20 18:23:05
my code is different so maybe someone can check but in v3 default they seems to be error

admincp line 1595 int ? - $sort = (int)$_POST["sort"];

in sql - enum  `sort` enum('yes','no') NOT NULL default 'yes',

html
<input type="radio" name="sort" value="yes" id="sort" /><?= Txt("YES") ?>
<input type="radio" name="sort" value="no" id="sort" /><?= Txt("NO") ?>
Last edited by M-jay warn on 2023-04-20 18:27:02
2023-04-20 22:34:00
int is correct for the auto_increment. If his code is being truncated, then he is exceeding the data int(10) being inserted into $sort somehow. It just leads me back to turning off mysql strict mode. Doing that usually fixes almost every single problem in v3
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2023-04-20 22:42:44
2023-04-21 06:23:30
i believe that may be wrong it should not be int for sort
sort seems to be enum yes, no  https://github.com/MicrosoulV3/TorrentTrader-v3/blob/master/TorrentTrader%203.0/Full%20Database.sql#L488

at admin polls on add poll the switch is yes, no i cant seem to find any relevance to sort in v3 its arranged by add so most recent first SELECT * FROM polls ORDER BY added

when adding/editing poll in admin i think the yes,no is been forced into int
2023-04-21 07:29:02
hello. I already disabled strict mode from the beginning.
2023-04-21 10:51:27
ahh, I see that, I missed that enum part. Try removing the (int) to make it $sort = $_POST["sort"];
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728