Table Relationship

taubes

Member
Hi,

I have a problem with a fresh installation. I am getting error messages in the admin section when tables have a relationship constraint.
Something like this for every relationship constraint.

Notice: Undefined index: column_name in /Users/stau/Sites/lim/include/db_functions_pdo.php on line 821
Notice: Undefined index: referenced_table_name in /Users/stau/Sites/lim/include/db_functions_pdo.php on line 821

This makes DaDabiK currently unusable. When I remove the relationship the error goes away and when I create a new one a new error pops up again. I also cannot reference the the table in form view because of the error. I am getting the same error with different Manarola Versions.

Not sure if this is a dadabik problem or MYSQL, but in other programs phpmyadmin and Sequel pro the relations ships work correctly.

I am using:
DaDaBIK version 10.2-Manarola platinum, installed on Aug 12, 2020
PHP Version: 7.2.33
mysql version: 8.0.21
Web server: Apache/2.4.43 (Unix) OpenSSL/1.1.1g PHP/7.2.33
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15
 

eugenio

Administrator
Staff member
Hi,
mmh strange, if you get that error, you should at least get also another error on line 821, do you?

Can you paste here the code you have on line 818, in case it gets corrupted? It should be:

$sql = "SELECT column_name, referenced_table_name, referenced_column_name FROM information_schema.KEY_COLUMN_USAGE WHERE table_schema = '".$db_name."' and table_name = '".$table_name."' and referenced_table_schema = '".$db_name."' and referenced_column_name IS NOT NULL";

Best,
 

taubes

Member
Hi,

The 818 is:
$sql = "SELECT column_name, referenced_table_name, referenced_column_name FROM information_schema.KEY_COLUMN_USAGE WHERE table_schema = '".$db_name."' and table_name = '".$table_name."' and referenced_table_schema = '".$db_name."' and referenced_column_name IS NOT NULL";

I get multiple repeats of this depending on how many restraints are on a table.
Notice: Undefined index: column_name in /Users/stau/Sites/lim/include/db_functions_pdo.php on line 821

Notice: Undefined index: referenced_table_name in /Users/stau/Sites/lim/include/db_functions_pdo.php on line 821

Notice: Undefined index: column_name in /Users/stau/Sites/lim/include/db_functions_pdo.php on line 822

Notice: Undefined index: referenced_column_name in /Users/stau/Sites/lim/include/db_functions_pdo.php on line 822

It feels like DaDaBik cannot read the information_schema properly. This was after a fresh mysql installation.

Thanks

Stefan
 

taubes

Member
Problem solved.

It was a mysql permission issue. DaDaBik was no longer able to read the information_schema because the (DaDaBiK) database user had insufficient permission. Your hint with the 818 query was very helpful. Damn mysql update ... now using mariadb.

Thanks

St
 
Top