Skip to content

Commit

Permalink
#243 #219 funcIn ,add log for NP
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhuqing666 committed Sep 1, 2017
1 parent cee05eb commit 85771c4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
import io.mycat.net.FrontendConnection;
import io.mycat.net.NIOHandler;
import io.mycat.net.mysql.MySQLPacket;
import io.mycat.server.NonBlockingSession;
import io.mycat.statistic.CommandCount;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
Expand All @@ -39,6 +42,7 @@
* @author mycat
*/
public class FrontendCommandHandler implements NIOHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(NonBlockingSession.class);
protected final ConcurrentLinkedQueue<byte[]> dataQueue = new ConcurrentLinkedQueue<>();
protected final AtomicBoolean handleStatus;
protected final FrontendConnection source;
Expand Down Expand Up @@ -131,6 +135,7 @@ public void run() {
handleData(data);
}
} catch (Exception e) {
LOGGER.warn("maybe occur a bug,", e);
source.writeErrMessage(ErrorCode.ER_UNKNOWN_ERROR, e.toString());
dataQueue.clear();
} finally {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/mycat/plan/common/item/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void setFixed(boolean fixed) {
public ItemResult getCmpContext() {
return cmpContext;
}

//TODO DELETE
public void setCmpContext(ItemResult cmpContext) {
this.cmpContext = cmpContext;
}
Expand Down
16 changes: 7 additions & 9 deletions src/main/java/io/mycat/plan/common/item/ItemField.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
package io.mycat.plan.common.item;

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;

import io.mycat.backend.mysql.CharsetUtil;
import io.mycat.config.ErrorCode;
import io.mycat.net.mysql.FieldPacket;
Expand All @@ -24,6 +16,12 @@
import io.mycat.plan.common.time.MySQLTime;
import io.mycat.plan.node.JoinNode;
import io.mycat.util.StringUtil;
import org.apache.commons.lang.StringUtils;

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;

public class ItemField extends ItemIdent {

Expand Down Expand Up @@ -75,7 +73,7 @@ public ItemType type() {

@Override
public ItemResult resultType() {
return field.resultType();
return field == null ? null : field.resultType();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


public class ItemFuncIn extends ItemFuncOptNeg {
//TODO :DELETE
private ItemResult leftResultType;

/**
Expand All @@ -22,7 +23,6 @@ public class ItemFuncIn extends ItemFuncOptNeg {
*/
public ItemFuncIn(List<Item> args, boolean isNegation) {
super(args, isNegation);
leftResultType = args.get(0).resultType();
}

@Override
Expand Down

0 comments on commit 85771c4

Please sign in to comment.