JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

JSQLParser 4.2 up to 4.4 hava a problem

Open afuchrisma opened this issue 3 years ago • 2 comments

hi~ JSQLParser 4.2 up to 4.4 vesion, I have a problem,net.sf.jsqlparser.expression.Function toString method When the database dialect is MySQL,when i want to assemble SQL totalcount , there are some differences, as shown in the picture 图片 How can I solve this problem give me some advice

afuchrisma avatar Jun 07 '22 08:06 afuchrisma

@afuchrisma

In my case I've changed the code snipped

Function countExpression = new Function();
countExpression.setName("count");
countExpression.setAllColumns(true);

To this one:

Function countExpression = new Function();
countExpression.setName("count");
countExpression.setParameters(new ExpressionList(new AllColumns()));

Hope it will help

amigalev avatar Jun 07 '22 10:06 amigalev

Greetings,

we have changed * from a Function property into an Expression AllColumns, which also supports Table References, e.g. f( a.* ).

Just access the Function's parameters and set or get the Expression of each parameter and test for AllColumns Expression.

manticore-projects avatar Jun 07 '22 12:06 manticore-projects

Closed, since no further questions asked.

manticore-projects avatar Nov 12 '22 06:11 manticore-projects