{"issue":{"milestone":{"open_issues":0,"title":"0.7.4","created_at":"2011-12-30T02:11:05Z","creator":{"login":"dynamobi-build","id":1123017,"url":"https://api.github.com/users/dynamobi-build","avatar_url":"https://secure.gravatar.com/avatar/cb215b3d786be20761071a562a56af64?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cb215b3d786be20761071a562a56af64"},"state":"closed","due_on":null,"closed_issues":3,"number":9,"description":null,"url":"https://api.github.com/repos/dynamobi/dynamobi/milestones/9"},"title":"[FRG-319] TRIM function throws StringIndexOutOfBoundsException when result would be empty string","created_at":"2011-12-30T03:35:01Z","user":{"login":"dynamobi-build","id":1123017,"url":"https://api.github.com/users/dynamobi-build","avatar_url":"https://secure.gravatar.com/avatar/cb215b3d786be20761071a562a56af64?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cb215b3d786be20761071a562a56af64"},"updated_at":"2011-12-30T03:35:04Z","state":"closed","labels":[{"name":"FRG","url":"https://api.github.com/repos/dynamobi/dynamobi/labels/FRG","color":"1f8f0d"},{"name":"Runtime","url":"https://api.github.com/repos/dynamobi/dynamobi/labels/Runtime","color":"886eef"}],"id":2686055,"closed_at":"2011-12-30T03:35:03Z","html_url":"https://github.com/dynamobi/dynamobi/issues/553","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"<b><i>[reporter=\"elin\", created=\"Mon, 5 May 2008 19:22:43 -0500 (GMT-05:00)\"]</i></b>\nLooks like anything which would result in an empty string output for the TRIM function give a StringIndexOutOfBoundsException.  We should return empty string instead.<br/>\n<br/>\nHere's the repro/stack trace:<br/>\n<br/>\n0: jdbc:luciddb:> values (trim('  '));<br/>\nError: java.lang.StringIndexOutOfBoundsException: String index out of range: -2 (state=,code=0)<br/>\nnet.sf.farrago.jdbc.FarragoJdbcUtil$FarragoSqlException: java.lang.StringIndexOutOfBoundsException: String index out of range: -2<br/>\n        at java.lang.String.checkBounds(String.java:368)<br/>\n        at java.lang.String.<init>(String.java:404)<br/>\n        at net.sf.farrago.type.runtime.EncodedCharPointer.toString(EncodedCharPointer.java:49)<br/>\n        at net.sf.farrago.type.runtime.EncodedCharPointer.getNullableData(EncodedCharPointer.java:77)<br/>\n        at net.sf.farrago.runtime.FarragoTupleIterResultSet.getRaw(FarragoTupleIterResultSet.java:227)<br/>\n        at org.eigenbase.util14.AbstractResultSet.getString(AbstractResultSet.java:195)<br/>\n        at net.sf.farrago.query.FarragoReentrantStmtExecutor.getResultRow(FarragoReentrantStmtExecutor.java:154)<br/>\n        at net.sf.farrago.query.FarragoReentrantStmtExecutor.executePlan(FarragoReentrantStmtExecutor.java:133)<br/>\n        at net.sf.farrago.query.FarragoReduceExpressionsRule$ReentrantValuesStmt.executeImpl(FarragoReduceExpressionsRule.java:425)<br/>\n        at net.sf.farrago.query.FarragoReentrantStmt.execute(FarragoReentrantStmt.java:104)<br/>\n        at net.sf.farrago.query.FarragoReduceExpressionsRule.reduceExpressions(FarragoReduceExpressionsRule.java:295)<br/>\n        at net.sf.farrago.query.FarragoReduceExpressionsRule$2.onMatch(FarragoReduceExpressionsRule.java:119)<br/>\n        at org.eigenbase.relopt.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:272)<br/>\n        at org.eigenbase.relopt.hep.HepPlanner.applyRule(HepPlanner.java:470)<br/>\n        at org.eigenbase.relopt.hep.HepPlanner.applyRules(HepPlanner.java:356)<br/>\n        at org.eigenbase.relopt.hep.HepPlanner.executeInstruction(HepPlanner.java:248)<br/>\n        at org.eigenbase.relopt.hep.HepInstruction$RuleClass.execute(HepInstruction.java:72)<br/>\n        at org.eigenbase.relopt.hep.HepPlanner.executeProgram(HepPlanner.java:173)<br/>\n        at org.eigenbase.relopt.hep.HepPlanner.findBestExp(HepPlanner.java:159)<br/>\n        at org.eigenbase.oj.stmt.OJPreparingStmt.optimize(OJPreparingStmt.java:364)<br/>\n        at net.sf.farrago.query.FarragoPreparingStmt.optimize(FarragoPreparingStmt.java:842)<br/>\n        at org.eigenbase.oj.stmt.OJPreparingStmt.prepareSql(OJPreparingStmt.java:329)<br/>\n        at net.sf.farrago.query.FarragoPreparingStmt.prepare(FarragoPreparingStmt.java:332)<br/>\n        at net.sf.farrago.db.FarragoDatabase$2.initializeEntry(FarragoDatabase.java:902)<br/>\n        at net.sf.farrago.util.FarragoObjectCache.tryPin(FarragoObjectCache.java:187)<br/>\n        at net.sf.farrago.util.FarragoObjectCache.pin(FarragoObjectCache.java:146)<br/>\n        at net.sf.farrago.db.FarragoDatabase.prepareStmtImpl(FarragoDatabase.java:931)<br/>\n        at net.sf.farrago.db.FarragoDatabase.prepareStmt(FarragoDatabase.java:777)<br/>\n        at net.sf.farrago.db.FarragoDbSession.prepareImpl(FarragoDbSession.java:1068)<br/>\n        at net.sf.farrago.db.FarragoDbSession.prepare(FarragoDbSession.java:993)<br/>\n        at net.sf.farrago.db.FarragoDbStmtContext.prepare(FarragoDbStmtContext.java:129)<br/>\n        at net.sf.farrago.jdbc.engine.FarragoJdbcEngineStatement.execute(FarragoJdbcEngineStatement.java:109)<br/>\n        at sqlline.SqlLine$Commands.execute(Unknown Source)<br/>\n        at sqlline.SqlLine$Commands.sql(Unknown Source)<br/>\n        at sqlline.SqlLine.dispatch(Unknown Source)<br/>\n        at sqlline.SqlLine.begin(Unknown Source)<br/>\n        at sqlline.SqlLine.mainWithInputRedirection(Unknown Source)<br/>\n        at sqlline.SqlLine.main(Unknown Source)<br/>\n0: jdbc:luciddb:> <br/>\n","number":553,"url":"https://api.github.com/repos/dynamobi/dynamobi/issues/553","comments":1,"assignee":null},"comment":{"created_at":"2011-12-30T03:35:04Z","user":{"login":"dynamobi-build","id":1123017,"url":"https://api.github.com/users/dynamobi-build","avatar_url":"https://secure.gravatar.com/avatar/cb215b3d786be20761071a562a56af64?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cb215b3d786be20761071a562a56af64"},"updated_at":"2011-12-30T03:35:04Z","id":3309969,"body":"<b><i>[author=\"jvs\", created=\"Wed, 7 May 2008 16:27:34 -0500 (GMT-05:00)\"]</i></b>\nFixed on lu/dev in eigenchange 11034.<br/>\n","url":"https://api.github.com/repos/dynamobi/dynamobi/issues/comments/3309969"},"action":"created"}