Platform forum

DbLib using MySql not operating properly

JimS , 12-17-2016, 01:11 PM
Hello All,
I have a MySql Db, populated and working,,,,, mostly. I find that I cannot use the Filter line in the Library pane when trying to add a component to a schematic. Anything typed into the Filter line is ignored. However, if I point at a flat library (SchLib) the filter works just fine. Is there a specific column needed in my Db tables? Flat libraries have a Column name called "Component Name", my Db does not contain this column, I did manually add it to one of my tables and placed a copy of what is in the Library Ref fields into it, but still no filter operation.
I have watched my network traffic using Wireshark, capturing the MySql packets and find only this vague message repeated numbers of times. "Expert Info (Warning/Undecoded): FIXME - dissector is incomplete." If I don't attempt using the filter, I have no errors or other issues. So I feel my connection scheme is fine.
I feel that a required field is not present in the Db, that the Filter is looking for.
I have found little at Altium that explains what are required fields for a Db, and no help regarding the use of MySql. I have also opened a service call on this subject with Altium support, but have not gotten any feedback as of yet. Thought I would look around and found this forum. There seems to be some knowledge here. Any ideas anyone?
robertferanec , 12-19-2016, 10:49 AM
Try right mouse button on one of the library column names and press "Select Columns". Try to select some columns and try it again.

Do not forget to use star character in front of the string you are looking for e.g. "*0805"

JimS , 12-19-2016, 12:17 PM
JimS , 12-19-2016, 12:19 PM
Robert evidently I didn't post the above correctly. none of my screen shots are visible.
robertferanec , 12-19-2016, 12:52 PM
To attach files, I normally use the "sheet" button on the right side (in front of the A and SMILE buttons) and then "Upload Attachment". However, I am not sure if I will be able to help with this issue
bkuschak , 07-10-2017, 12:44 PM
Old post, but I ran into the same problem.
This is the reason it fails. Altium has a syntax error in their query string. They are missing the 'Where' keyword. I filed a bug against 17.0.11, but I don't have any expectation it will be fixed.

mysql> Select * From `resistor - chip` `Description` LIKE '%0402%' OR `Value` LIKE
'%0402%' OR `Manufacturer` LIKE '%0402%';

mysql> Select * From `resistor - chip` `Description` LIKE '%0402%' OR `Value` LIKE
-> '%0402%' OR `Manufacturer` LIKE '%0402%';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIKE '%0402%' OR `Value` LIKE
'%0402%' OR `Manufacturer` LIKE '%0402%'' at line 1

This is what Altium SHOULD send. Notice the addition of the word 'Where'. Query results a result.

mysql> Select * From `resistor - chip` Where `Description` LIKE '%0402%' OR `Value` LIKE
'%0402%' OR `Manufacturer` LIKE '%0402%';

mysql> Select * From `resistor - chip` Where `Description` LIKE '%0402%' OR `Value` LIKE
-> '%0402%' OR `Manufacturer` LIKE '%0402%';

| 1 | 10k | =Value | ERJ-2RKF1002X | Panasonic Electronic Components | RES SMD 10K OHM 1% 1/10W 0402 | Digi-Key | P10.0KLTR-ND | RES 0402/1005 | Footprints/Passives.PcbLib | Resistor | Symbols/Passives.SchLib | Datasheet | http://industrial.panasonic.com/www-...2RKF1002X+7+WW | Digikey listing | http://digikey.com/product-detail/en...KLTR-ND/192073 | | | -55C ~ 155C | 100ppm/C | 1% | 0.1W, 1/10W | | | RES 0402/1005 RF | Passives.PcbLib | | | 0.0043 | Thick Film | 0402 (1005 Metric) |

1 row in set (0.00 sec)

I was hoping to write a TCP proxy server to intercept this bad query, fix it, and then forward it on to the MySQL server. Unfortunately the syntax error seems to be caught by the ODBC driver, and no packet is actually transmitted in this case. (The query text was read from the error dialog box.)
robertferanec , 07-11-2017, 01:38 AM
WOW! Thanks for sharing this!
Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?