bugs when some configs is not default value

Bug #1065779 reported by Alvin Peng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stado
Fix Committed
Undecided
Unassigned

Bug Description

Hi,

There is problem with some configs if they are not set to default value.

1). xdb.identifier.quote

The default value is "\"", and in SqlExpression.java rebuildExpression(...) function, it uses below statement:

aSqlExpression.exprString.startsWith("\"")

This will cause problem if we set the config with a new value (e.g. "\`") other than "\"", for example, when executing the SQL

select name,count(*) from info group by name;

The query plan contains a query string like:

select ```in````na```, count(*) ....

This is incorrect.

Update aSqlExpression.exprString.startsWith("\"") to

aSqlExpression.exprString.startsWith(Props.XDB_IDENTIFIER_QUOTE)

can fix this bug.

2). xdb.use_load_for_step

The default value is "true".

If we set it to false. When executing a SQL like

insert into info2 select * from info;

An exception is got:

Node 1 has aborted execution, cause is: java.lang.NullPointerException : null

The cause is in ProducerSender.java, sendToNodes(ResultSet...) function:

if (aStepDetail.targetSchema.indexOf("XSERIALID") > 0){
...

From the execution step, the targetSchema is null, so this statement will cause exception.

Adding check with (aStepDetail.targetSchema != null) can fix this bug.

Related branches

Revision history for this message
Andrei Martsinchyk (andrei-martsinchyk) wrote :

1) I do not see aSqlExpression.exprString.startsWith("\"") in the SqlExpression.java rebuildExpression(...) function, probably you are working with modified code. Anyway, it looks like proper fix is aSqlExpression.exprString.startsWith(Props.XDB_IDENTIFIER_QUOTE_START);

2) Fix for this case is committed.

Changed in stado:
status: New → Incomplete
Revision history for this message
Alvin Peng (pengalvin) wrote :

Hi Andrei,

1) the codes are in /src/org/postgresql/stado/optimizer/SqlExpression.java:

private static String rebuildExpression(SqlExpression aSqlExpression,
   XDBSessionContext client) {
..

Line 846: && !aSqlExpression.exprString.startsWith("\"")) {

Revision history for this message
Andrei Martsinchyk (andrei-martsinchyk) wrote :

Ah, now I see it, thanks.
The fix is committed.

Changed in stado:
status: Incomplete → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.