table_track truncation

I just got a table_track truncation in BxDolViews.php and I am trying to understand why.  No problem with inserting the database table, the full name of the table is there; but table_track truncated it for some reason.

Line 71:

        $iTs = (int)($GLOBALS['MySQL']->getOne("SELECT `ts` FROM `{$this->_aSystem['table_track']}` WHERE `id` = '" . $this->getId() . "' $sWhere"));

Geeks, making the world a better place
Quote · 14 Jan 2014

Sorry but i don't understand what you're asking...

so much to do....
Quote · 14 Jan 2014

See this part:

FROM `{$this->_aSystem['table_track']}`

That part gets changed into the name of the table; mydatabase.mytable

so the sql query is FROM 'mydatabase.mytable

Evidently my resultant table name is too long and gets truncated which then throws a database error that the table does not exist.

Geeks, making the world a better place
Quote · 14 Jan 2014

you shouldn't have table names longer than 64 chars. I am not sure if thats what causing issues for you.

so much to do....
Quote · 14 Jan 2014

 

you shouldn't have table names longer than 64 chars. I am not sure if thats what causing issues for you.

No, it is 32; which is sort of long for a table name, even when you add the database name it is only around 42.  And Dolphin should expect that it might see a 64 character long table name. 

So, how does this table_track thing work?

Geeks, making the world a better place
Quote · 14 Jan 2014

Actually its 64 i think. http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

anyway you said you're getting a db query error so something must be wrong with your query. Check it for errors. Take the prepared query from the error page. Assuming you had turned on db debug mode.

so much to do....
Quote · 14 Jan 2014

 

Actually its 64 i think. http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

anyway you said you're getting a db query error so something must be wrong with your query. Check it for errors. Take the prepared query from the error page. Assuming you had turned on db debug mode.

Yes, 64 but I have less than 64.  The error is that the database table names gets truncated so that is the cause of the error, the wrong name.  See below

 

See this part:

FROM `{$this->_aSystem['table_track']}`

That part gets changed into the name of the table; mydatabase.mytable

so the sql query is FROM 'mydatabase.mytable

Evidently my resultant table name is too long and gets truncated which then throws a database error that the table does not exist.

Geeks, making the world a better place
Quote · 14 Jan 2014

well thanks, saying the same thing 3 times helped me understand it better Foot in Mouth 

I am very well aware what that code does but i don't have a magic solution to just fix it with the amount of code you posted. You have to debug it yourself like the way i told already.

so much to do....
Quote · 14 Jan 2014

OK, it is a Dolphin bug.  The actually error is "table does not exist", that is the sql error.  So looking at the database error I saw where the name of the table got truncated for some reason, it was only one character but that is enough. 

I posted thinking someone else may have stumbled across this bug.  The name of the table is within the allowable mySQL length; only around 32 characters.  No, I haven't dug through the code yet; the purpose of the post was if someone else had indeed came across this it could save me some time.

I may recode for now to reduce the length of the table name and come back to it later; I will post it has a bug report and maybe AlexT will come along.  This is for a site that needs to go live soon and I really don't have a lot of time to waste tracking down why Dolphin truncated a table name that was nowhere near the limit.

Geeks, making the world a better place
Quote · 14 Jan 2014

well i am not aware of any dolphin function (or bug somehow) that play with table name at all (unless its the search class). You write the sql and it just executes it and play with the result not the query itself. This could be false if dolphin was using PDO with prepared statements which it doesn't as of now. So my 2 cents is that its a coding error. I would like to see the bug report with reproducing instructions when you post it. Lets see what it is Undecided

so much to do....
Quote · 14 Jan 2014

Never Ever seen this error before.

https://www.deanbassett.com
Quote · 14 Jan 2014

The problem is that it is not my site; I can not post screenshots and errors without releasing information that is confidential.  The site is not heavily modified but it is entirely possible a change elsewhere has affected this.  I am going to recode the table name to reduce it in length and see if the name is not truncated.

Geeks, making the world a better place
Quote · 14 Jan 2014

if I ever run into a problem where a table field is truncating an entry (so far 4 times), I change the field type from varchar(xxx) to TEXT. And I never have the problem with that field again.

caredesign.net
Quote · 14 Jan 2014

 

if I ever run into a problem where a table field is truncating an entry (so far 4 times), I change the field type from varchar(xxx) to TEXT. And I never have the problem with that field again.

No, that is not the issue.  The issue is that in generating the sql query, Dolphin truncated the table name, which resulted in a mysql error of table not found.

Geeks, making the world a better place
Quote · 14 Jan 2014

This is a limitation in sys_objects_view table, table_track field length is 32 chars.

Actually most of table fields where table names are stored are limited to 32 characters, so try limit your tables names under 32 chars.

Rules → http://www.boonex.com/terms
Quote · 21 Jan 2014

 

This is a limitation in sys_objects_view table, table_track field length is 32 chars.

Actually most of table fields where table names are stored are limited to 32 characters, so try limit your tables names under 32 chars.

 Yes, that is what I did, I limited the table name.  Why the limit to 32 if mySQL tables can be 64?

Geeks, making the world a better place
Quote · 21 Jan 2014

 

 

This is a limitation in sys_objects_view table, table_track field length is 32 chars.

Actually most of table fields where table names are stored are limited to 32 characters, so try limit your tables names under 32 chars.

 Yes, that is what I did, I limited the table name.  Why the limit to 32 if mySQL tables can be 64?

It just should be enough for most cases, but we consider to increase it in future versions.

Rules → http://www.boonex.com/terms
Quote · 25 Jan 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.