diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java index 252a71444d26..56a22448b7b5 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java @@ -1082,78 +1082,78 @@ private boolean LookAheadTokenIsNotHypen_sempred(RuleContext _localctx, int pred "\u0280\2\u0282\u00fe\u0284\u00ff\u0286\2\u0288\u0100\u028a\u0101\u028c"+ "\2\u028e\u0102\u0290\u0103\u0292\2\u0294\u0104\u0296\u0105\u0298\u0106"+ "\u029a\2\u029c\2\u029e\2\22\2\3\4\5\6\7\b\t\n\13\f\r\16\17\20\21*\3\2"+ - "\63;\4\2ZZzz\5\2\62;CHch\4\2GGgg\4\2--//\6\2FFHHffhh\4\2RRrr\4\2$$^^\n"+ - "\2$$))^^ddhhppttvv\6\2--\61;C\\c|\5\2C\\aac|\26\2\2\u0081\u00a3\u00a9"+ - "\u00ab\u00ab\u00ad\u00ae\u00b0\u00b0\u00b2\u00b3\u00b8\u00b9\u00bd\u00bd"+ - "\u00c1\u00c1\u00d9\u00d9\u00f9\u00f9\u2010\u202b\u2032\u2060\u2192\u2c01"+ - "\u3003\u3005\u300a\u3022\u3032\u3032\udb82\uf901\ufd40\ufd41\ufe47\ufe48"+ - "\b\2\13\f\17\17C\\c|\u2010\u2011\u202a\u202b\6\2$$\61\61^^~~\7\2ddhhp"+ - "pttvv\4\2\2\u0081\ud802\udc01\3\2\ud802\udc01\3\2\udc02\ue001\6\2\62;"+ - "C\\aac|\4\2\13\13\"\"\4\2\f\f\16\17\4\2\f\f\17\17\5\2\f\f\"\"bb\3\2\""+ - "\"\3\2\f\f\4\2\f\fbb\3\2bb\3\2//\7\2&&((>>bb}}\5\2\13\f\17\17\"\"\3\2"+ - "\62;\5\2\u00b9\u00b9\u0302\u0371\u2041\u2042\n\2C\\aac|\u2072\u2191\u2c02"+ - "\u2ff1\u3003\ud801\uf902\ufdd1\ufdf2\uffff\b\2$$&&>>^^}}\177\177\b\2&"+ - "&))>>^^}}\177\177\6\2&&@A}}\177\177\6\2&&//@@}}\5\2&&^^bb\6\2&&^^bb}}"+ - "\f\2$$))^^bbddhhppttvv}}\u0c69\2\22\3\2\2\2\2\24\3\2\2\2\2\26\3\2\2\2"+ - "\2\30\3\2\2\2\2\32\3\2\2\2\2\34\3\2\2\2\2\36\3\2\2\2\2 \3\2\2\2\2\"\3"+ - "\2\2\2\2$\3\2\2\2\2&\3\2\2\2\2(\3\2\2\2\2*\3\2\2\2\2,\3\2\2\2\2.\3\2\2"+ - "\2\2\60\3\2\2\2\2\62\3\2\2\2\2\64\3\2\2\2\2\66\3\2\2\2\28\3\2\2\2\2:\3"+ - "\2\2\2\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2\2\2B\3\2\2\2\2D\3\2\2\2\2F\3\2\2"+ - "\2\2H\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2N\3\2\2\2\2P\3\2\2\2\2R\3\2\2\2\2"+ - "T\3\2\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3\2\2\2\2\\\3\2\2\2\2^\3\2\2\2\2`\3"+ - "\2\2\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2\2\2\2h\3\2\2\2\2j\3\2\2\2\2l\3\2\2"+ - "\2\2n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2\2t\3\2\2\2\2v\3\2\2\2\2x\3\2\2\2\2"+ - "z\3\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080\3\2\2\2\2\u0082\3\2\2\2\2\u0084"+ - "\3\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2\2\2\u008a\3\2\2\2\2\u008c\3\2\2"+ - "\2\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0092\3\2\2\2\2\u0094\3\2\2\2\2\u0096"+ - "\3\2\2\2\2\u0098\3\2\2\2\2\u009a\3\2\2\2\2\u009c\3\2\2\2\2\u009e\3\2\2"+ - "\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2\2\2\u00a4\3\2\2\2\2\u00a6\3\2\2\2\2\u00a8"+ - "\3\2\2\2\2\u00aa\3\2\2\2\2\u00ac\3\2\2\2\2\u00ae\3\2\2\2\2\u00b0\3\2\2"+ - "\2\2\u00b2\3\2\2\2\2\u00b4\3\2\2\2\2\u00b6\3\2\2\2\2\u00b8\3\2\2\2\2\u00ba"+ - "\3\2\2\2\2\u00bc\3\2\2\2\2\u00be\3\2\2\2\2\u00c0\3\2\2\2\2\u00c2\3\2\2"+ - "\2\2\u00c4\3\2\2\2\2\u00c6\3\2\2\2\2\u00c8\3\2\2\2\2\u00ca\3\2\2\2\2\u00cc"+ - "\3\2\2\2\2\u00ce\3\2\2\2\2\u00d0\3\2\2\2\2\u00d2\3\2\2\2\2\u00d4\3\2\2"+ - "\2\2\u00d6\3\2\2\2\2\u00d8\3\2\2\2\2\u00da\3\2\2\2\2\u00dc\3\2\2\2\2\u00de"+ - "\3\2\2\2\2\u00e0\3\2\2\2\2\u00e2\3\2\2\2\2\u00e4\3\2\2\2\2\u00e6\3\2\2"+ - "\2\2\u00e8\3\2\2\2\2\u00ea\3\2\2\2\2\u00ec\3\2\2\2\2\u00ee\3\2\2\2\2\u00f0"+ - "\3\2\2\2\2\u00f2\3\2\2\2\2\u00f4\3\2\2\2\2\u00f6\3\2\2\2\2\u00f8\3\2\2"+ - "\2\2\u00fa\3\2\2\2\2\u00fc\3\2\2\2\2\u00fe\3\2\2\2\2\u0100\3\2\2\2\2\u0102"+ - "\3\2\2\2\2\u0104\3\2\2\2\2\u0106\3\2\2\2\2\u0108\3\2\2\2\2\u010a\3\2\2"+ - "\2\2\u010c\3\2\2\2\2\u010e\3\2\2\2\2\u0110\3\2\2\2\2\u0112\3\2\2\2\2\u0114"+ - "\3\2\2\2\2\u0116\3\2\2\2\2\u0118\3\2\2\2\2\u011a\3\2\2\2\2\u011c\3\2\2"+ - "\2\2\u011e\3\2\2\2\2\u0120\3\2\2\2\2\u0122\3\2\2\2\2\u0124\3\2\2\2\2\u0126"+ - "\3\2\2\2\2\u012a\3\2\2\2\2\u012c\3\2\2\2\2\u012e\3\2\2\2\2\u0130\3\2\2"+ - "\2\2\u0132\3\2\2\2\2\u0134\3\2\2\2\2\u0136\3\2\2\2\2\u0138\3\2\2\2\2\u013a"+ - "\3\2\2\2\2\u013c\3\2\2\2\2\u013e\3\2\2\2\2\u0140\3\2\2\2\2\u0142\3\2\2"+ - "\2\2\u0144\3\2\2\2\2\u0146\3\2\2\2\2\u0148\3\2\2\2\2\u014a\3\2\2\2\2\u014c"+ - "\3\2\2\2\2\u014e\3\2\2\2\2\u0150\3\2\2\2\2\u0152\3\2\2\2\2\u0154\3\2\2"+ - "\2\2\u0156\3\2\2\2\2\u0158\3\2\2\2\2\u015a\3\2\2\2\2\u015c\3\2\2\2\2\u015e"+ - "\3\2\2\2\2\u0160\3\2\2\2\2\u0162\3\2\2\2\2\u0164\3\2\2\2\2\u0166\3\2\2"+ - "\2\2\u0168\3\2\2\2\2\u016a\3\2\2\2\2\u016c\3\2\2\2\2\u016e\3\2\2\2\2\u0170"+ - "\3\2\2\2\2\u0172\3\2\2\2\2\u0174\3\2\2\2\2\u0176\3\2\2\2\2\u0178\3\2\2"+ - "\2\2\u017a\3\2\2\2\2\u017c\3\2\2\2\2\u017e\3\2\2\2\2\u0180\3\2\2\2\2\u0194"+ - "\3\2\2\2\2\u0196\3\2\2\2\2\u01aa\3\2\2\2\2\u01ac\3\2\2\2\2\u01b6\3\2\2"+ - "\2\2\u01ba\3\2\2\2\2\u01c4\3\2\2\2\2\u01c6\3\2\2\2\2\u01da\3\2\2\2\2\u01dc"+ - "\3\2\2\2\2\u01de\3\2\2\2\2\u01e0\3\2\2\2\2\u01e2\3\2\2\2\2\u01e4\3\2\2"+ - "\2\2\u01e6\3\2\2\2\2\u01e8\3\2\2\2\3\u01ea\3\2\2\2\3\u01ec\3\2\2\2\3\u01ee"+ - "\3\2\2\2\3\u01f0\3\2\2\2\3\u01f2\3\2\2\2\3\u01f4\3\2\2\2\3\u01f6\3\2\2"+ - "\2\3\u01f8\3\2\2\2\3\u01fc\3\2\2\2\3\u01fe\3\2\2\2\3\u0200\3\2\2\2\4\u0202"+ - "\3\2\2\2\4\u0204\3\2\2\2\4\u0206\3\2\2\2\5\u0208\3\2\2\2\5\u020a\3\2\2"+ - "\2\6\u020c\3\2\2\2\6\u020e\3\2\2\2\7\u0210\3\2\2\2\7\u0212\3\2\2\2\b\u0214"+ - "\3\2\2\2\b\u0216\3\2\2\2\b\u0218\3\2\2\2\b\u021a\3\2\2\2\b\u021c\3\2\2"+ - "\2\b\u0220\3\2\2\2\b\u0222\3\2\2\2\b\u0224\3\2\2\2\b\u0226\3\2\2\2\b\u022a"+ - "\3\2\2\2\b\u022c\3\2\2\2\t\u0236\3\2\2\2\t\u0238\3\2\2\2\t\u023a\3\2\2"+ - "\2\t\u023c\3\2\2\2\t\u023e\3\2\2\2\t\u0240\3\2\2\2\t\u0242\3\2\2\2\t\u0244"+ - "\3\2\2\2\t\u0246\3\2\2\2\t\u0248\3\2\2\2\n\u0252\3\2\2\2\n\u0254\3\2\2"+ - "\2\n\u0256\3\2\2\2\13\u025a\3\2\2\2\13\u025c\3\2\2\2\13\u025e\3\2\2\2"+ - "\f\u0264\3\2\2\2\f\u0266\3\2\2\2\r\u0270\3\2\2\2\r\u0272\3\2\2\2\r\u0276"+ - "\3\2\2\2\16\u0282\3\2\2\2\16\u0284\3\2\2\2\17\u0288\3\2\2\2\17\u028a\3"+ - "\2\2\2\20\u028e\3\2\2\2\20\u0290\3\2\2\2\21\u0294\3\2\2\2\21\u0296\3\2"+ - "\2\2\21\u0298\3\2\2\2\22\u02a0\3\2\2\2\24\u02a7\3\2\2\2\26\u02aa\3\2\2"+ - "\2\30\u02b1\3\2\2\2\32\u02b9\3\2\2\2\34\u02c2\3\2\2\2\36\u02c8\3\2\2\2"+ - " \u02d0\3\2\2\2\"\u02d9\3\2\2\2$\u02e2\3\2\2\2&\u02e9\3\2\2\2(\u02f0\3"+ - "\2\2\2*\u02fb\3\2\2\2,\u0305\3\2\2\2.\u0311\3\2\2\2\60\u0318\3\2\2\2\62"+ - "\u0321\3\2\2\2\64\u0328\3\2\2\2\66\u032e\3\2\2\28\u0336\3\2\2\2:\u033e"+ + "\63;\4\2ZZzz\5\2\62;CHch\4\2GGgg\4\2--//\6\2FFHHffhh\4\2RRrr\6\2\f\f\17"+ + "\17$$^^\n\2$$))^^ddhhppttvv\6\2--\61;C\\c|\5\2C\\aac|\26\2\2\u0081\u00a3"+ + "\u00a9\u00ab\u00ab\u00ad\u00ae\u00b0\u00b0\u00b2\u00b3\u00b8\u00b9\u00bd"+ + "\u00bd\u00c1\u00c1\u00d9\u00d9\u00f9\u00f9\u2010\u202b\u2032\u2060\u2192"+ + "\u2c01\u3003\u3005\u300a\u3022\u3032\u3032\udb82\uf901\ufd40\ufd41\ufe47"+ + "\ufe48\b\2\13\f\17\17C\\c|\u2010\u2011\u202a\u202b\6\2$$\61\61^^~~\7\2"+ + "ddhhppttvv\4\2\2\u0081\ud802\udc01\3\2\ud802\udc01\3\2\udc02\ue001\6\2"+ + "\62;C\\aac|\4\2\13\13\"\"\4\2\f\f\16\17\4\2\f\f\17\17\5\2\f\f\"\"bb\3"+ + "\2\"\"\3\2\f\f\4\2\f\fbb\3\2bb\3\2//\7\2&&((>>bb}}\5\2\13\f\17\17\"\""+ + "\3\2\62;\5\2\u00b9\u00b9\u0302\u0371\u2041\u2042\n\2C\\aac|\u2072\u2191"+ + "\u2c02\u2ff1\u3003\ud801\uf902\ufdd1\ufdf2\uffff\b\2$$&&>>^^}}\177\177"+ + "\b\2&&))>>^^}}\177\177\6\2&&@A}}\177\177\6\2&&//@@}}\5\2&&^^bb\6\2&&^"+ + "^bb}}\f\2$$))^^bbddhhppttvv}}\u0c69\2\22\3\2\2\2\2\24\3\2\2\2\2\26\3\2"+ + "\2\2\2\30\3\2\2\2\2\32\3\2\2\2\2\34\3\2\2\2\2\36\3\2\2\2\2 \3\2\2\2\2"+ + "\"\3\2\2\2\2$\3\2\2\2\2&\3\2\2\2\2(\3\2\2\2\2*\3\2\2\2\2,\3\2\2\2\2.\3"+ + "\2\2\2\2\60\3\2\2\2\2\62\3\2\2\2\2\64\3\2\2\2\2\66\3\2\2\2\28\3\2\2\2"+ + "\2:\3\2\2\2\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2\2\2B\3\2\2\2\2D\3\2\2\2\2F"+ + "\3\2\2\2\2H\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2N\3\2\2\2\2P\3\2\2\2\2R\3\2"+ + "\2\2\2T\3\2\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3\2\2\2\2\\\3\2\2\2\2^\3\2\2"+ + "\2\2`\3\2\2\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2\2\2\2h\3\2\2\2\2j\3\2\2\2\2"+ + "l\3\2\2\2\2n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2\2t\3\2\2\2\2v\3\2\2\2\2x\3"+ + "\2\2\2\2z\3\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080\3\2\2\2\2\u0082\3\2\2"+ + "\2\2\u0084\3\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2\2\2\u008a\3\2\2\2\2\u008c"+ + "\3\2\2\2\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0092\3\2\2\2\2\u0094\3\2\2"+ + "\2\2\u0096\3\2\2\2\2\u0098\3\2\2\2\2\u009a\3\2\2\2\2\u009c\3\2\2\2\2\u009e"+ + "\3\2\2\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2\2\2\u00a4\3\2\2\2\2\u00a6\3\2\2"+ + "\2\2\u00a8\3\2\2\2\2\u00aa\3\2\2\2\2\u00ac\3\2\2\2\2\u00ae\3\2\2\2\2\u00b0"+ + "\3\2\2\2\2\u00b2\3\2\2\2\2\u00b4\3\2\2\2\2\u00b6\3\2\2\2\2\u00b8\3\2\2"+ + "\2\2\u00ba\3\2\2\2\2\u00bc\3\2\2\2\2\u00be\3\2\2\2\2\u00c0\3\2\2\2\2\u00c2"+ + "\3\2\2\2\2\u00c4\3\2\2\2\2\u00c6\3\2\2\2\2\u00c8\3\2\2\2\2\u00ca\3\2\2"+ + "\2\2\u00cc\3\2\2\2\2\u00ce\3\2\2\2\2\u00d0\3\2\2\2\2\u00d2\3\2\2\2\2\u00d4"+ + "\3\2\2\2\2\u00d6\3\2\2\2\2\u00d8\3\2\2\2\2\u00da\3\2\2\2\2\u00dc\3\2\2"+ + "\2\2\u00de\3\2\2\2\2\u00e0\3\2\2\2\2\u00e2\3\2\2\2\2\u00e4\3\2\2\2\2\u00e6"+ + "\3\2\2\2\2\u00e8\3\2\2\2\2\u00ea\3\2\2\2\2\u00ec\3\2\2\2\2\u00ee\3\2\2"+ + "\2\2\u00f0\3\2\2\2\2\u00f2\3\2\2\2\2\u00f4\3\2\2\2\2\u00f6\3\2\2\2\2\u00f8"+ + "\3\2\2\2\2\u00fa\3\2\2\2\2\u00fc\3\2\2\2\2\u00fe\3\2\2\2\2\u0100\3\2\2"+ + "\2\2\u0102\3\2\2\2\2\u0104\3\2\2\2\2\u0106\3\2\2\2\2\u0108\3\2\2\2\2\u010a"+ + "\3\2\2\2\2\u010c\3\2\2\2\2\u010e\3\2\2\2\2\u0110\3\2\2\2\2\u0112\3\2\2"+ + "\2\2\u0114\3\2\2\2\2\u0116\3\2\2\2\2\u0118\3\2\2\2\2\u011a\3\2\2\2\2\u011c"+ + "\3\2\2\2\2\u011e\3\2\2\2\2\u0120\3\2\2\2\2\u0122\3\2\2\2\2\u0124\3\2\2"+ + "\2\2\u0126\3\2\2\2\2\u012a\3\2\2\2\2\u012c\3\2\2\2\2\u012e\3\2\2\2\2\u0130"+ + "\3\2\2\2\2\u0132\3\2\2\2\2\u0134\3\2\2\2\2\u0136\3\2\2\2\2\u0138\3\2\2"+ + "\2\2\u013a\3\2\2\2\2\u013c\3\2\2\2\2\u013e\3\2\2\2\2\u0140\3\2\2\2\2\u0142"+ + "\3\2\2\2\2\u0144\3\2\2\2\2\u0146\3\2\2\2\2\u0148\3\2\2\2\2\u014a\3\2\2"+ + "\2\2\u014c\3\2\2\2\2\u014e\3\2\2\2\2\u0150\3\2\2\2\2\u0152\3\2\2\2\2\u0154"+ + "\3\2\2\2\2\u0156\3\2\2\2\2\u0158\3\2\2\2\2\u015a\3\2\2\2\2\u015c\3\2\2"+ + "\2\2\u015e\3\2\2\2\2\u0160\3\2\2\2\2\u0162\3\2\2\2\2\u0164\3\2\2\2\2\u0166"+ + "\3\2\2\2\2\u0168\3\2\2\2\2\u016a\3\2\2\2\2\u016c\3\2\2\2\2\u016e\3\2\2"+ + "\2\2\u0170\3\2\2\2\2\u0172\3\2\2\2\2\u0174\3\2\2\2\2\u0176\3\2\2\2\2\u0178"+ + "\3\2\2\2\2\u017a\3\2\2\2\2\u017c\3\2\2\2\2\u017e\3\2\2\2\2\u0180\3\2\2"+ + "\2\2\u0194\3\2\2\2\2\u0196\3\2\2\2\2\u01aa\3\2\2\2\2\u01ac\3\2\2\2\2\u01b6"+ + "\3\2\2\2\2\u01ba\3\2\2\2\2\u01c4\3\2\2\2\2\u01c6\3\2\2\2\2\u01da\3\2\2"+ + "\2\2\u01dc\3\2\2\2\2\u01de\3\2\2\2\2\u01e0\3\2\2\2\2\u01e2\3\2\2\2\2\u01e4"+ + "\3\2\2\2\2\u01e6\3\2\2\2\2\u01e8\3\2\2\2\3\u01ea\3\2\2\2\3\u01ec\3\2\2"+ + "\2\3\u01ee\3\2\2\2\3\u01f0\3\2\2\2\3\u01f2\3\2\2\2\3\u01f4\3\2\2\2\3\u01f6"+ + "\3\2\2\2\3\u01f8\3\2\2\2\3\u01fc\3\2\2\2\3\u01fe\3\2\2\2\3\u0200\3\2\2"+ + "\2\4\u0202\3\2\2\2\4\u0204\3\2\2\2\4\u0206\3\2\2\2\5\u0208\3\2\2\2\5\u020a"+ + "\3\2\2\2\6\u020c\3\2\2\2\6\u020e\3\2\2\2\7\u0210\3\2\2\2\7\u0212\3\2\2"+ + "\2\b\u0214\3\2\2\2\b\u0216\3\2\2\2\b\u0218\3\2\2\2\b\u021a\3\2\2\2\b\u021c"+ + "\3\2\2\2\b\u0220\3\2\2\2\b\u0222\3\2\2\2\b\u0224\3\2\2\2\b\u0226\3\2\2"+ + "\2\b\u022a\3\2\2\2\b\u022c\3\2\2\2\t\u0236\3\2\2\2\t\u0238\3\2\2\2\t\u023a"+ + "\3\2\2\2\t\u023c\3\2\2\2\t\u023e\3\2\2\2\t\u0240\3\2\2\2\t\u0242\3\2\2"+ + "\2\t\u0244\3\2\2\2\t\u0246\3\2\2\2\t\u0248\3\2\2\2\n\u0252\3\2\2\2\n\u0254"+ + "\3\2\2\2\n\u0256\3\2\2\2\13\u025a\3\2\2\2\13\u025c\3\2\2\2\13\u025e\3"+ + "\2\2\2\f\u0264\3\2\2\2\f\u0266\3\2\2\2\r\u0270\3\2\2\2\r\u0272\3\2\2\2"+ + "\r\u0276\3\2\2\2\16\u0282\3\2\2\2\16\u0284\3\2\2\2\17\u0288\3\2\2\2\17"+ + "\u028a\3\2\2\2\20\u028e\3\2\2\2\20\u0290\3\2\2\2\21\u0294\3\2\2\2\21\u0296"+ + "\3\2\2\2\21\u0298\3\2\2\2\22\u02a0\3\2\2\2\24\u02a7\3\2\2\2\26\u02aa\3"+ + "\2\2\2\30\u02b1\3\2\2\2\32\u02b9\3\2\2\2\34\u02c2\3\2\2\2\36\u02c8\3\2"+ + "\2\2 \u02d0\3\2\2\2\"\u02d9\3\2\2\2$\u02e2\3\2\2\2&\u02e9\3\2\2\2(\u02f0"+ + "\3\2\2\2*\u02fb\3\2\2\2,\u0305\3\2\2\2.\u0311\3\2\2\2\60\u0318\3\2\2\2"+ + "\62\u0321\3\2\2\2\64\u0328\3\2\2\2\66\u032e\3\2\2\28\u0336\3\2\2\2:\u033e"+ "\3\2\2\2<\u0346\3\2\2\2>\u034f\3\2\2\2@\u0356\3\2\2\2B\u035c\3\2\2\2D"+ "\u0363\3\2\2\2F\u036a\3\2\2\2H\u0371\3\2\2\2J\u0374\3\2\2\2L\u037e\3\2"+ "\2\2N\u0384\3\2\2\2P\u0387\3\2\2\2R\u038e\3\2\2\2T\u0394\3\2\2\2V\u039a"+ @@ -1755,56 +1755,55 @@ private boolean LookAheadTokenIsNotHypen_sempred(RuleContext _localctx, int pred "\3\2\2\2\u0945\u0948\3\2\2\2\u0946\u0944\3\2\2\2\u0946\u0947\3\2\2\2\u0947"+ "\u094a\3\2\2\2\u0948\u0946\3\2\2\2\u0949\u094b\t\32\2\2\u094a\u0949\3"+ "\2\2\2\u094a\u094b\3\2\2\2\u094b\u094d\3\2\2\2\u094c\u093b\3\2\2\2\u094d"+ - "\u094e\3\2\2\2\u094e\u094c\3\2\2\2\u094e\u094f\3\2\2\2\u094f\u095d\3\2"+ - "\2\2"; + "\u094e\3\2\2\2\u094e\u094c\3\2\2\2\u094e\u094f\3\2\2\2\u094f\u095d"; private static final String _serializedATNSegment1 = - "\u0950\u0959\n\33\2\2\u0951\u0952\5\u0158\u00a5\2\u0952\u0953\n\34\2\2"+ - "\u0953\u0959\3\2\2\2\u0954\u0955\5\u0158\u00a5\2\u0955\u0956\5\u0158\u00a5"+ - "\2\u0956\u0957\n\34\2\2\u0957\u0959\3\2\2\2\u0958\u0950\3\2\2\2\u0958"+ - "\u0951\3\2\2\2\u0958\u0954\3\2\2\2\u0959\u095a\3\2\2\2\u095a\u0958\3\2"+ - "\2\2\u095a\u095b\3\2\2\2\u095b\u095d\3\2\2\2\u095c\u0939\3\2\2\2\u095c"+ - "\u0958\3\2\2\2\u095d\u0211\3\2\2\2\u095e\u095f\5\u0158\u00a5\2\u095f\u0960"+ - "\5\u0158\u00a5\2\u0960\u0961\5\u0158\u00a5\2\u0961\u0962\3\2\2\2\u0962"+ - "\u0963\b\u0102!\2\u0963\u0213\3\2\2\2\u0964\u0965\7>\2\2\u0965\u0966\7"+ - "#\2\2\u0966\u0967\7/\2\2\u0967\u0968\7/\2\2\u0968\u0969\3\2\2\2\u0969"+ - "\u096a\b\u0103\"\2\u096a\u0215\3\2\2\2\u096b\u096c\7>\2\2\u096c\u096d"+ - "\7#\2\2\u096d\u096e\7]\2\2\u096e\u096f\7E\2\2\u096f\u0970\7F\2\2\u0970"+ - "\u0971\7C\2\2\u0971\u0972\7V\2\2\u0972\u0973\7C\2\2\u0973\u0974\7]\2\2"+ - "\u0974\u0978\3\2\2\2\u0975\u0977\13\2\2\2\u0976\u0975\3\2\2\2\u0977\u097a"+ - "\3\2\2\2\u0978\u0979\3\2\2\2\u0978\u0976\3\2\2\2\u0979\u097b\3\2\2\2\u097a"+ - "\u0978\3\2\2\2\u097b\u097c\7_\2\2\u097c\u097d\7_\2\2\u097d\u097e\7@\2"+ - "\2\u097e\u0217\3\2\2\2\u097f\u0980\7>\2\2\u0980\u0981\7#\2\2\u0981\u0986"+ - "\3\2\2\2\u0982\u0983\n\35\2\2\u0983\u0987\13\2\2\2\u0984\u0985\13\2\2"+ - "\2\u0985\u0987\n\35\2\2\u0986\u0982\3\2\2\2\u0986\u0984\3\2\2\2\u0987"+ - "\u098b\3\2\2\2\u0988\u098a\13\2\2\2\u0989\u0988\3\2\2\2\u098a\u098d\3"+ - "\2\2\2\u098b\u098c\3\2\2\2\u098b\u0989\3\2\2\2\u098c\u098e\3\2\2\2\u098d"+ - "\u098b\3\2\2\2\u098e\u098f\7@\2\2\u098f\u0990\3\2\2\2\u0990\u0991\b\u0105"+ - "#\2\u0991\u0219\3\2\2\2\u0992\u0993\7(\2\2\u0993\u0994\5\u0246\u011c\2"+ - "\u0994\u0995\7=\2\2\u0995\u021b\3\2\2\2\u0996\u0997\7(\2\2\u0997\u0998"+ - "\7%\2\2\u0998\u099a\3\2\2\2\u0999\u099b\5\u0186\u00bc\2\u099a\u0999\3"+ - "\2\2\2\u099b\u099c\3\2\2\2\u099c\u099a\3\2\2\2\u099c\u099d\3\2\2\2\u099d"+ - "\u099e\3\2\2\2\u099e\u099f\7=\2\2\u099f\u09ac\3\2\2\2\u09a0\u09a1\7(\2"+ - "\2\u09a1\u09a2\7%\2\2\u09a2\u09a3\7z\2\2\u09a3\u09a5\3\2\2\2\u09a4\u09a6"+ - "\5\u0190\u00c1\2\u09a5\u09a4\3\2\2\2\u09a6\u09a7\3\2\2\2\u09a7\u09a5\3"+ - "\2\2\2\u09a7\u09a8\3\2\2\2\u09a8\u09a9\3\2\2\2\u09a9\u09aa\7=\2\2\u09aa"+ - "\u09ac\3\2\2\2\u09ab\u0996\3\2\2\2\u09ab\u09a0\3\2\2\2\u09ac\u021d\3\2"+ - "\2\2\u09ad\u09b3\t\25\2\2\u09ae\u09b0\7\17\2\2\u09af\u09ae\3\2\2\2\u09af"+ - "\u09b0\3\2\2\2\u09b0\u09b1\3\2\2\2\u09b1\u09b3\7\f\2\2\u09b2\u09ad\3\2"+ - "\2\2\u09b2\u09af\3\2\2\2\u09b3\u021f\3\2\2\2\u09b4\u09b5\5\u013e\u0098"+ - "\2\u09b5\u09b6\3\2\2\2\u09b6\u09b7\b\u0109$\2\u09b7\u0221\3\2\2\2\u09b8"+ - "\u09b9\7>\2\2\u09b9\u09ba\7\61\2\2\u09ba\u09bb\3\2\2\2\u09bb\u09bc\b\u010a"+ - "$\2\u09bc\u0223\3\2\2\2\u09bd\u09be\7>\2\2\u09be\u09bf\7A\2\2\u09bf\u09c3"+ - "\3\2\2\2\u09c0\u09c1\5\u0246\u011c\2\u09c1\u09c2\5\u023e\u0118\2\u09c2"+ - "\u09c4\3\2\2\2\u09c3\u09c0\3\2\2\2\u09c3\u09c4\3\2\2\2\u09c4\u09c5\3\2"+ - "\2\2\u09c5\u09c6\5\u0246\u011c\2\u09c6\u09c7\5\u021e\u0108\2\u09c7\u09c8"+ - "\3\2\2\2\u09c8\u09c9\b\u010b%\2\u09c9\u0225\3\2\2\2\u09ca\u09cb\7b\2\2"+ - "\u09cb\u09cc\b\u010c&\2\u09cc\u09cd\3\2\2\2\u09cd\u09ce\b\u010c!\2\u09ce"+ - "\u0227\3\2\2\2\u09cf\u09d0\7&\2\2\u09d0\u09d1\7}\2\2\u09d1\u0229\3\2\2"+ - "\2\u09d2\u09d4\5\u022c\u010f\2\u09d3\u09d2\3\2\2\2\u09d3\u09d4\3\2\2\2"+ - "\u09d4\u09d5\3\2\2\2\u09d5\u09d6\5\u0228\u010d\2\u09d6\u09d7\3\2\2\2\u09d7"+ - "\u09d8\b\u010e\'\2\u09d8\u022b\3\2\2\2\u09d9\u09db\5\u022e\u0110\2\u09da"+ - "\u09d9\3\2\2\2\u09db\u09dc\3\2\2\2\u09dc\u09da\3\2\2\2\u09dc\u09dd\3\2"+ - "\2\2\u09dd\u022d\3\2\2\2\u09de\u09e6\n\36\2\2\u09df\u09e0\7^\2\2\u09e0"+ + "\3\2\2\2\u0950\u0959\n\33\2\2\u0951\u0952\5\u0158\u00a5\2\u0952\u0953"+ + "\n\34\2\2\u0953\u0959\3\2\2\2\u0954\u0955\5\u0158\u00a5\2\u0955\u0956"+ + "\5\u0158\u00a5\2\u0956\u0957\n\34\2\2\u0957\u0959\3\2\2\2\u0958\u0950"+ + "\3\2\2\2\u0958\u0951\3\2\2\2\u0958\u0954\3\2\2\2\u0959\u095a\3\2\2\2\u095a"+ + "\u0958\3\2\2\2\u095a\u095b\3\2\2\2\u095b\u095d\3\2\2\2\u095c\u0939\3\2"+ + "\2\2\u095c\u0958\3\2\2\2\u095d\u0211\3\2\2\2\u095e\u095f\5\u0158\u00a5"+ + "\2\u095f\u0960\5\u0158\u00a5\2\u0960\u0961\5\u0158\u00a5\2\u0961\u0962"+ + "\3\2\2\2\u0962\u0963\b\u0102!\2\u0963\u0213\3\2\2\2\u0964\u0965\7>\2\2"+ + "\u0965\u0966\7#\2\2\u0966\u0967\7/\2\2\u0967\u0968\7/\2\2\u0968\u0969"+ + "\3\2\2\2\u0969\u096a\b\u0103\"\2\u096a\u0215\3\2\2\2\u096b\u096c\7>\2"+ + "\2\u096c\u096d\7#\2\2\u096d\u096e\7]\2\2\u096e\u096f\7E\2\2\u096f\u0970"+ + "\7F\2\2\u0970\u0971\7C\2\2\u0971\u0972\7V\2\2\u0972\u0973\7C\2\2\u0973"+ + "\u0974\7]\2\2\u0974\u0978\3\2\2\2\u0975\u0977\13\2\2\2\u0976\u0975\3\2"+ + "\2\2\u0977\u097a\3\2\2\2\u0978\u0979\3\2\2\2\u0978\u0976\3\2\2\2\u0979"+ + "\u097b\3\2\2\2\u097a\u0978\3\2\2\2\u097b\u097c\7_\2\2\u097c\u097d\7_\2"+ + "\2\u097d\u097e\7@\2\2\u097e\u0217\3\2\2\2\u097f\u0980\7>\2\2\u0980\u0981"+ + "\7#\2\2\u0981\u0986\3\2\2\2\u0982\u0983\n\35\2\2\u0983\u0987\13\2\2\2"+ + "\u0984\u0985\13\2\2\2\u0985\u0987\n\35\2\2\u0986\u0982\3\2\2\2\u0986\u0984"+ + "\3\2\2\2\u0987\u098b\3\2\2\2\u0988\u098a\13\2\2\2\u0989\u0988\3\2\2\2"+ + "\u098a\u098d\3\2\2\2\u098b\u098c\3\2\2\2\u098b\u0989\3\2\2\2\u098c\u098e"+ + "\3\2\2\2\u098d\u098b\3\2\2\2\u098e\u098f\7@\2\2\u098f\u0990\3\2\2\2\u0990"+ + "\u0991\b\u0105#\2\u0991\u0219\3\2\2\2\u0992\u0993\7(\2\2\u0993\u0994\5"+ + "\u0246\u011c\2\u0994\u0995\7=\2\2\u0995\u021b\3\2\2\2\u0996\u0997\7(\2"+ + "\2\u0997\u0998\7%\2\2\u0998\u099a\3\2\2\2\u0999\u099b\5\u0186\u00bc\2"+ + "\u099a\u0999\3\2\2\2\u099b\u099c\3\2\2\2\u099c\u099a\3\2\2\2\u099c\u099d"+ + "\3\2\2\2\u099d\u099e\3\2\2\2\u099e\u099f\7=\2\2\u099f\u09ac\3\2\2\2\u09a0"+ + "\u09a1\7(\2\2\u09a1\u09a2\7%\2\2\u09a2\u09a3\7z\2\2\u09a3\u09a5\3\2\2"+ + "\2\u09a4\u09a6\5\u0190\u00c1\2\u09a5\u09a4\3\2\2\2\u09a6\u09a7\3\2\2\2"+ + "\u09a7\u09a5\3\2\2\2\u09a7\u09a8\3\2\2\2\u09a8\u09a9\3\2\2\2\u09a9\u09aa"+ + "\7=\2\2\u09aa\u09ac\3\2\2\2\u09ab\u0996\3\2\2\2\u09ab\u09a0\3\2\2\2\u09ac"+ + "\u021d\3\2\2\2\u09ad\u09b3\t\25\2\2\u09ae\u09b0\7\17\2\2\u09af\u09ae\3"+ + "\2\2\2\u09af\u09b0\3\2\2\2\u09b0\u09b1\3\2\2\2\u09b1\u09b3\7\f\2\2\u09b2"+ + "\u09ad\3\2\2\2\u09b2\u09af\3\2\2\2\u09b3\u021f\3\2\2\2\u09b4\u09b5\5\u013e"+ + "\u0098\2\u09b5\u09b6\3\2\2\2\u09b6\u09b7\b\u0109$\2\u09b7\u0221\3\2\2"+ + "\2\u09b8\u09b9\7>\2\2\u09b9\u09ba\7\61\2\2\u09ba\u09bb\3\2\2\2\u09bb\u09bc"+ + "\b\u010a$\2\u09bc\u0223\3\2\2\2\u09bd\u09be\7>\2\2\u09be\u09bf\7A\2\2"+ + "\u09bf\u09c3\3\2\2\2\u09c0\u09c1\5\u0246\u011c\2\u09c1\u09c2\5\u023e\u0118"+ + "\2\u09c2\u09c4\3\2\2\2\u09c3\u09c0\3\2\2\2\u09c3\u09c4\3\2\2\2\u09c4\u09c5"+ + "\3\2\2\2\u09c5\u09c6\5\u0246\u011c\2\u09c6\u09c7\5\u021e\u0108\2\u09c7"+ + "\u09c8\3\2\2\2\u09c8\u09c9\b\u010b%\2\u09c9\u0225\3\2\2\2\u09ca\u09cb"+ + "\7b\2\2\u09cb\u09cc\b\u010c&\2\u09cc\u09cd\3\2\2\2\u09cd\u09ce\b\u010c"+ + "!\2\u09ce\u0227\3\2\2\2\u09cf\u09d0\7&\2\2\u09d0\u09d1\7}\2\2\u09d1\u0229"+ + "\3\2\2\2\u09d2\u09d4\5\u022c\u010f\2\u09d3\u09d2\3\2\2\2\u09d3\u09d4\3"+ + "\2\2\2\u09d4\u09d5\3\2\2\2\u09d5\u09d6\5\u0228\u010d\2\u09d6\u09d7\3\2"+ + "\2\2\u09d7\u09d8\b\u010e\'\2\u09d8\u022b\3\2\2\2\u09d9\u09db\5\u022e\u0110"+ + "\2\u09da\u09d9\3\2\2\2\u09db\u09dc\3\2\2\2\u09dc\u09da\3\2\2\2\u09dc\u09dd"+ + "\3\2\2\2\u09dd\u022d\3\2\2\2\u09de\u09e6\n\36\2\2\u09df\u09e0\7^\2\2\u09e0"+ "\u09e6\t\34\2\2\u09e1\u09e6\5\u021e\u0108\2\u09e2\u09e6\5\u0232\u0112"+ "\2\u09e3\u09e6\5\u0230\u0111\2\u09e4\u09e6\5\u0234\u0113\2\u09e5\u09de"+ "\3\2\2\2\u09e5\u09df\3\2\2\2\u09e5\u09e1\3\2\2\2\u09e5\u09e2\3\2\2\2\u09e5"+ diff --git a/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 b/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 index 9c3b0e242bac..847994f3e979 100644 --- a/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 +++ b/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 @@ -369,7 +369,7 @@ StringCharacters fragment StringCharacter - : ~["\\] + : ~["\\\u000A\u000D] | EscapeSequence ; diff --git a/examples/jdbc-client-batch-update/jdbc_client_batch_update.bal b/examples/jdbc-client-batch-update/jdbc_client_batch_update.bal index 36845e8f4a53..2b537bcdb604 100644 --- a/examples/jdbc-client-batch-update/jdbc_client_batch_update.bal +++ b/examples/jdbc-client-batch-update/jdbc_client_batch_update.bal @@ -25,8 +25,8 @@ public function main() { // statement execution is successful, the `update` remote function // returns 0. io:println("The update operation - Creating a table:"); - var ret = testDB->update("CREATE TABLE student(id INT AUTO_INCREMENT, - age INT, name VARCHAR(255), PRIMARY KEY (id))"); + var ret = testDB->update("CREATE TABLE student(id INT AUTO_INCREMENT, " + + "age INT, name VARCHAR(255), PRIMARY KEY (id))"); handleUpdate(ret, "Create student table"); json jsonMsg = { @@ -65,8 +65,8 @@ public function main() { // A batch of data can be inserted using the `batchUpdate` remote function. // The number of inserted rows for each insert in the batch is returned as // an array. - jdbc:BatchUpdateResult retBatch = testDB->batchUpdate("INSERT INTO student - (age,name) VALUES (?,?)", false, ...dataBatch); + jdbc:BatchUpdateResult retBatch = testDB->batchUpdate("INSERT INTO student " + + "(age,name) VALUES (?,?)", false, ...dataBatch); error? e = retBatch.returnedError; if (e is error) { io:println("Batch update operation failed:", diff --git a/examples/jdbc-client-call-procedures/jdbc_client_call_procedures.bal b/examples/jdbc-client-call-procedures/jdbc_client_call_procedures.bal index eb3b2278b618..c07ddacce447 100644 --- a/examples/jdbc-client-call-procedures/jdbc_client_call_procedures.bal +++ b/examples/jdbc-client-call-procedures/jdbc_client_call_procedures.bal @@ -23,26 +23,26 @@ public function main() { // statement execution is successful, the `update` remote function // returns 0. io:println("The update operation - Creating table and procedures:"); - var ret = testDB->update("CREATE TABLE student(id INT AUTO_INCREMENT, - age INT, name VARCHAR(255), PRIMARY KEY (id))"); + var ret = testDB->update("CREATE TABLE student(id INT AUTO_INCREMENT, " + + "age INT, name VARCHAR(255), PRIMARY KEY (id))"); handleUpdate(ret, "Create student table"); // Create the stored procedure with IN parameters. - ret = testDB->update("CREATE PROCEDURE INSERTDATA(IN pAge INT, - IN pName VARCHAR(255)) - BEGIN - INSERT INTO student(age, name) values (pAge, pName); - END"); + ret = testDB->update("CREATE PROCEDURE INSERTDATA(IN pAge INT, " + + "IN pName VARCHAR(255)) " + + "BEGIN " + + "INSERT INTO student(age, name) values (pAge, pName); " + + "END"); handleUpdate(ret, "Stored procedure with IN param creation"); // Create the stored procedure with INOUT and OUT parameters. - ret = testDB->update("CREATE PROCEDURE GETCOUNT (INOUT pID INT, - OUT pCount INT) - BEGIN - SELECT id INTO pID FROM student WHERE age = pID; - SELECT COUNT(*) INTO pCount FROM student - WHERE age = 20; - END"); + ret = testDB->update("CREATE PROCEDURE GETCOUNT (INOUT pID INT, " + + "OUT pCount INT) " + + "BEGIN " + + "SELECT id INTO pID FROM student WHERE age = pID; " + + "SELECT COUNT(*) INTO pCount FROM student " + + "WHERE age = 20; " + + "END"); handleUpdate(ret, "Stored procedure with INOUT/OUT param creation"); diff --git a/examples/jdbc-client-crud-operations/jdbc_client_crud_operations.bal b/examples/jdbc-client-crud-operations/jdbc_client_crud_operations.bal index 71f76163daa1..76433d07dba1 100644 --- a/examples/jdbc-client-crud-operations/jdbc_client_crud_operations.bal +++ b/examples/jdbc-client-crud-operations/jdbc_client_crud_operations.bal @@ -24,8 +24,8 @@ public function main() { // statement execution is successful, the `update` remote function // returns 0. io:println("The update operation - Creating a table"); - var ret = testDB->update("CREATE TABLE student(id INT AUTO_INCREMENT, - age INT, name VARCHAR(255), PRIMARY KEY (id))"); + var ret = testDB->update("CREATE TABLE student(id INT AUTO_INCREMENT, " + + "age INT, name VARCHAR(255), PRIMARY KEY (id))"); handleUpdate(ret, "Create student table"); // Insert data to the table using the `update` remote function. If the DML @@ -33,8 +33,8 @@ public function main() { // the updated row count. The query parameters are given in the query // statement itself. io:println("\nThe update operation - Inserting data to a table"); - ret = testDB->update("INSERT INTO student(age, name) values - (23, 'john')"); + ret = testDB->update("INSERT INTO student(age, name) values " + + "(23, 'john')"); handleUpdate(ret, "Insert to student table with no parameters"); // The query parameters are given as variables for the `update` remote @@ -77,8 +77,8 @@ public function main() { io:println("\nThe Update operation - Inserting data"); age = 31; name = "Kate"; - var retWithKey = testDB->update("INSERT INTO student - (age, name) values (?, ?)", age, name); + var retWithKey = testDB->update("INSERT INTO student " + + "(age, name) values (?, ?)", age, name); if (retWithKey is jdbc:UpdateResult) { int count = retWithKey.updatedRowCount; int generatedKey = retWithKey.generatedKeys["GENERATED_KEY"]; diff --git a/examples/jdbc-streaming-big-dataset/big_data_service.bal b/examples/jdbc-streaming-big-dataset/big_data_service.bal index efdee76d5a01..7d408dc24d3b 100644 --- a/examples/jdbc-streaming-big-dataset/big_data_service.bal +++ b/examples/jdbc-streaming-big-dataset/big_data_service.bal @@ -31,8 +31,8 @@ service dataService on new http:Listener(9090) { // Set a payload indicating an error in case the data retrieval // fails. res.statusCode = http:STATUS_INTERNAL_SERVER_ERROR; - res.setPayload({ "Error": "Error occured while retrieving data - from the database" }); + res.setPayload({ "Error": "Error occured while retrieving data " + + "from the database" }); } // Respond to the client. diff --git a/examples/jdbc-streaming-big-dataset/data_setup.bal b/examples/jdbc-streaming-big-dataset/data_setup.bal index 01f11cc7cd4c..b17667d49cc2 100644 --- a/examples/jdbc-streaming-big-dataset/data_setup.bal +++ b/examples/jdbc-streaming-big-dataset/data_setup.bal @@ -9,28 +9,28 @@ public function main() { }); // Create a table for data insertion. - var ret = testDB->update("CREATE TABLE Data (id INT, field1 - VARCHAR(1024), field2 VARCHAR(1024));"); + var ret = testDB->update("CREATE TABLE Data (id INT, field1 " + + "VARCHAR(1024), field2 VARCHAR(1024));"); handleUpdate(ret, "Create Data table"); // Create the stored procedure with row_count IN parameter. - ret = testDB->update("CREATE PROCEDURE PopulateData(IN row_count INT) - BEGIN - DECLARE count INT; - DECLARE strDataEntry VARCHAR(1024); - SET count = 1; - SET strDataEntry = ''; - WHILE count <= 1024 DO - SET strDataEntry = CONCAT(strDataEntry, 'x'); - SET count = count + 1; - END WHILE; - SET count = 1; - WHILE count <= row_count DO - INSERT INTO Data VALUES (count, strDataEntry, strDataEntry); - SET count = count + 1; - END WHILE; - SELECT strDataEntry; - END"); + ret = testDB->update("CREATE PROCEDURE PopulateData(IN row_count INT) " + + "BEGIN " + + "DECLARE count INT; " + + "DECLARE strDataEntry VARCHAR(1024); " + + "SET count = 1; " + + "SET strDataEntry = ''; " + + "WHILE count <= 1024 DO " + + "SET strDataEntry = CONCAT(strDataEntry, 'x'); " + + "SET count = count + 1; " + + "END WHILE; " + + "SET count = 1; " + + "WHILE count <= row_count DO " + + "INSERT INTO Data VALUES (count, strDataEntry, strDataEntry); " + + "SET count = count + 1; " + + "END WHILE; " + + "SELECT strDataEntry; " + + "END"); handleUpdate(ret, "Stored procedure with IN param creation"); // Call stored procedure. This inserts around 200MB of textual data. diff --git a/examples/local-transactions/local_transactions.bal b/examples/local-transactions/local_transactions.bal index 511dd37413cf..440be12b84b2 100644 --- a/examples/local-transactions/local_transactions.bal +++ b/examples/local-transactions/local_transactions.bal @@ -11,8 +11,8 @@ jdbc:Client testDB = new ({ public function main() { // Creates the tables that are required for the transaction. - var ret = testDB->update("CREATE TABLE CUSTOMER (ID INTEGER, NAME - VARCHAR(30))"); + var ret = testDB->update("CREATE TABLE CUSTOMER (ID INTEGER, NAME " + + "VARCHAR(30))"); handleUpdate(ret, "Create CUSTOMER table"); ret = testDB->update("CREATE TABLE SALARY (ID INTEGER, MON_SALARY FLOAT)"); @@ -28,11 +28,11 @@ public function main() { // aborting it. Only integer literals or constants are allowed as the `retry count`. transaction with retries = 4 { // This is the first remote function participant of the transaction. - ret = testDB->update("INSERT INTO CUSTOMER(ID,NAME) - VALUES (1, 'Anne')"); + ret = testDB->update("INSERT INTO CUSTOMER(ID,NAME) " + + "VALUES (1, 'Anne')"); // This is the second remote function participant of the transaction. - ret = testDB->update("INSERT INTO SALARY (ID, MON_SALARY) - VALUES (1, 2500)"); + ret = testDB->update("INSERT INTO SALARY (ID, MON_SALARY) " + + "VALUES (1, 2500)"); if (ret is jdbc:UpdateResult) { io:println("Inserted count: ", ret.updatedRowCount); // If the transaction is forced to abort, it will roll back the transaction diff --git a/examples/rabbitmq-producer/rabbitmq_producer.bal b/examples/rabbitmq-producer/rabbitmq_producer.bal index 127481d78a01..052c74f0a804 100644 --- a/examples/rabbitmq-producer/rabbitmq_producer.bal +++ b/examples/rabbitmq-producer/rabbitmq_producer.bal @@ -26,8 +26,8 @@ public function main() { worker w1 { var sendResult = newChannel1->basicPublish("Hello from Ballerina", "MyQueue1"); if (sendResult is error) { - io:println("An error occurred while sending the message to - MyQueue1 using newChannel1."); + io:println("An error occurred while sending the message to " + + "MyQueue1 using newChannel1."); } } @@ -36,8 +36,8 @@ public function main() { worker w2 { var sendResult = newChannel2->basicPublish("Hello from Ballerina", "MyQueue1"); if (sendResult is error) { - io:println("An error occurred while sending the message to - MyQueue1 using newChannel2."); + io:println("An error occurred while sending the message to " + + "MyQueue1 using newChannel2."); } } @@ -46,8 +46,8 @@ public function main() { worker w3 { var sendResult = newChannel1->basicPublish("Hello from Ballerina", "MyQueue2"); if (sendResult is error) { - io:println("An error occurred while sending the message to - MyQueue2 using newChannel1."); + io:println("An error occurred while sending the message to " + + "MyQueue2 using newChannel1."); } } _ = wait {w1, w2, w3}; diff --git a/examples/request-with-multiparts/request_with_multiparts.bal b/examples/request-with-multiparts/request_with_multiparts.bal index 953d02f81c80..9d519c0c4d0a 100644 --- a/examples/request-with-multiparts/request_with_multiparts.bal +++ b/examples/request-with-multiparts/request_with_multiparts.bal @@ -71,8 +71,8 @@ service multipartDemoService on new http:Listener(9090) { } } else { http:Response response = new; - response.setPayload("Error occurred while sending multipart - request!"); + response.setPayload("Error occurred while sending multipart " + + "request!"); response.statusCode = 500; var result = caller->respond(response); if (result is error) { diff --git a/examples/table-queries/table_queries.bal b/examples/table-queries/table_queries.bal index 182cf1872ba1..4471164ed808 100644 --- a/examples/table-queries/table_queries.bal +++ b/examples/table-queries/table_queries.bal @@ -122,10 +122,10 @@ public function main() { tempOrderTable.items as items, tempOrderTable.amount as amount; queryStmt = "\ntable orderDetailsTable = " + - "from personTable as tempPersonTable - join orderTable as tempOrderTable " + - "on tempPersonTable.id == tempOrderTable.personId - select tempOrderTable.orderId as orderId, " + + "from personTable as tempPersonTable " + + "join orderTable as tempOrderTable " + + "on tempPersonTable.id == tempOrderTable.personId " + + "select tempOrderTable.orderId as orderId, " + "tempPersonTable.name as personName, " + "tempOrderTable.items as items, " + "tempOrderTable.amount as amount;"; @@ -143,13 +143,13 @@ public function main() { tempOrderTable.items as items, tempOrderTable.amount as amount; queryStmt = "\ntable orderDetailsWithFilter = " + - "from personTable where name != 'jane' as tempPersonTable - join orderTable where personId != 3 as tempOrderTable " + - "on tempPersonTable.id == tempOrderTable.personId - select tempOrderTable.orderId as orderId, " + - "tempPersonTable.name as personName," + - "tempOrderTable.items as items, - tempOrderTable.amount as amount;"; + "from personTable where name != 'jane' as tempPersonTable " + + "join orderTable where personId != 3 as tempOrderTable " + + "on tempPersonTable.id == tempOrderTable.personId " + + "select tempOrderTable.orderId as orderId, " + + "tempPersonTable.name as personName, " + + "tempOrderTable.items as items, " + + "tempOrderTable.amount as amount;"; printTable(queryStmt, "orderDetailsWithFilter: ", orderDetailsWithFilter); } diff --git a/examples/transactions-distributed/participant.bal b/examples/transactions-distributed/participant.bal index 0ffb9a0861db..f047de927854 100644 --- a/examples/transactions-distributed/participant.bal +++ b/examples/transactions-distributed/participant.bal @@ -33,10 +33,9 @@ service ParticipantService on new http:Listener(8889) { var updateReq = <@untainted> req.getJsonPayload(); if (updateReq is json) { string msg = - io:sprintf("Update stock quote request received. - symbol:%s, price:%s", - updateReq.symbol, - updateReq.price); + io:sprintf("Update stock quote request received. " + + "symbol:%s, price:%s", + updateReq.symbol, updateReq.price); log:printInfo(msg); json jsonRes = { "message": "updating stock" }; diff --git a/examples/xa-transactions/xa_transactions.bal b/examples/xa-transactions/xa_transactions.bal index 5b2d3b2392c6..056df5db44f1 100644 --- a/examples/xa-transactions/xa_transactions.bal +++ b/examples/xa-transactions/xa_transactions.bal @@ -21,8 +21,8 @@ jdbc:Client testDB2 = new({ public function main() { // Creates the table named CUSTOMER in the first database. - var ret = testDB1->update("CREATE TABLE CUSTOMER (ID INTEGER - AUTO_INCREMENT, NAME VARCHAR(30))"); + var ret = testDB1->update("CREATE TABLE CUSTOMER (ID INTEGER " + + "AUTO_INCREMENT, NAME VARCHAR(30))"); handleUpdate(ret, "Create CUSTOMER table"); // Creates the table named SALARY in the second database. ret = testDB2->update("CREATE TABLE SALARY (ID INT, VALUE FLOAT)"); @@ -32,8 +32,8 @@ public function main() { transaction { // This is the first remote function to participate in the transaction. It inserts // the customer name to the first DB and gets the generated key. - var result = testDB1->update("INSERT INTO CUSTOMER(NAME) - VALUES ('Anne')"); + var result = testDB1->update("INSERT INTO CUSTOMER(NAME) " + + "VALUES ('Anne')"); int key = -1; if (result is jdbc:UpdateResult) { int count = result.updatedRowCount; diff --git a/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTableQuery.bal b/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTableQuery.bal index 73d9ef751f22..0edc07de5816 100644 --- a/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTableQuery.bal +++ b/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTableQuery.bal @@ -168,10 +168,10 @@ public function main() { tempOrderTable.amount as amount; queryStmt = "\ntable orderDetailsTable = " + - "from personTable as tempPersonTable - join orderTable as tempOrderTable " + - "on tempPersonTable.id == tempOrderTable.personId - select tempOrderTable.orderId as orderId, " + + "from personTable as tempPersonTable " + + "join orderTable as tempOrderTable " + + "on tempPersonTable.id == tempOrderTable.personId " + + "select tempOrderTable.orderId as orderId, " + "tempPersonTable.name as personName, " + "tempOrderTable.items as items, " + "tempOrderTable.amount as amount;"; @@ -191,13 +191,13 @@ public function main() { tempOrderTable.amount as amount; queryStmt = "\ntable orderDetailsWithFilter = " + - "from personTable where name != 'jane' as tempPersonTable - join orderTable where personId != 3 as tempOrderTable " + - "on tempPersonTable.id == tempOrderTable.personId - select tempOrderTable.orderId as orderId, " + + "from personTable where name != 'jane' as tempPersonTable " + + "join orderTable where personId != 3 as tempOrderTable " + + "on tempPersonTable.id == tempOrderTable.personId " + + "select tempOrderTable.orderId as orderId," + "tempPersonTable.name as personName," + - "tempOrderTable.items as items, - tempOrderTable.amount as amount;"; + "tempOrderTable.items as items," + + "tempOrderTable.amount as amount;"; printTable(queryStmt, "orderDetailsWithFilter: ", orderDetailsWithFilter); } diff --git a/language-server/modules/langserver-core/src/test/resources/formatting/tableQuery.bal b/language-server/modules/langserver-core/src/test/resources/formatting/tableQuery.bal index 14ba7320a053..2ca77961c5a7 100644 --- a/language-server/modules/langserver-core/src/test/resources/formatting/tableQuery.bal +++ b/language-server/modules/langserver-core/src/test/resources/formatting/tableQuery.bal @@ -137,10 +137,10 @@ public function main() { tempOrderTable.amount as amount; queryStmt = "\ntable orderDetailsTable = " + - "from personTable as tempPersonTable - join orderTable as tempOrderTable " + - "on tempPersonTable.id == tempOrderTable.personId - select tempOrderTable.orderId as orderId, " + + "from personTable as tempPersonTable " + + "join orderTable as tempOrderTable " + + "on tempPersonTable.id == tempOrderTable.personId " + + "select tempOrderTable.orderId as orderId, " + "tempPersonTable.name as personName, " + "tempOrderTable.items as items, " + "tempOrderTable.amount as amount;"; @@ -160,13 +160,13 @@ public function main() { tempOrderTable.amount as amount; queryStmt = "\ntable orderDetailsWithFilter = " + - "from personTable where name != 'jane' as tempPersonTable - join orderTable where personId != 3 as tempOrderTable " + - "on tempPersonTable.id == tempOrderTable.personId - select tempOrderTable.orderId as orderId, " + + "from personTable where name != 'jane' as tempPersonTable " + + "join orderTable where personId != 3 as tempOrderTable " + + "on tempPersonTable.id == tempOrderTable.personId " + + "select tempOrderTable.orderId as orderId," + "tempPersonTable.name as personName," + - "tempOrderTable.items as items, - tempOrderTable.amount as amount;"; + "tempOrderTable.items as items," + + "tempOrderTable.amount as amount;"; printTable(queryStmt, "orderDetailsWithFilter: ", orderDetailsWithFilter); } diff --git a/stdlib/jdbc/src/main/ballerina/src/java.jdbc/Module.md b/stdlib/jdbc/src/main/ballerina/src/java.jdbc/Module.md index 63c6e8b9b229..f0db5f330869 100644 --- a/stdlib/jdbc/src/main/ballerina/src/java.jdbc/Module.md +++ b/stdlib/jdbc/src/main/ballerina/src/java.jdbc/Module.md @@ -126,8 +126,8 @@ The CREATE statement is executed via the `update` remote function of the client. ```ballerina // Create the ‘Students’ table with fields ‘id’, 'name' and ‘age’. -var returned = testDB->update("CREATE TABLE student(id INT AUTO_INCREMENT, age INT, - name VARCHAR(255), PRIMARY KEY (id))"); +var returned = testDB->update("CREATE TABLE student(id INT AUTO_INCREMENT, age INT, " + + "name VARCHAR(255), PRIMARY KEY (id))"); if (returned is jdbc:UpdateResult) { io:println("Students table create status in DB: ", returned.updatedRowCount); } else { diff --git a/stdlib/jdbc/src/test/resources/test-src/actions/batch_update_test.bal b/stdlib/jdbc/src/test/resources/test-src/actions/batch_update_test.bal index 3151f07c9a40..f69a47aa5120 100644 --- a/stdlib/jdbc/src/test/resources/test-src/actions/batch_update_test.bal +++ b/stdlib/jdbc/src/test/resources/test-src/actions/batch_update_test.bal @@ -46,8 +46,8 @@ function testBatchUpdate(string jdbcURL) returns [int[], jdbc:Error?, int, int] para5 = {sqlType: jdbc:TYPE_VARCHAR, value: "Colombo"}; jdbc:Parameter?[] parameters2 = [para1, para2, para3, para4, para5]; - jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (firstName,lastName,registrationID, - creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); + jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (firstName,lastName,registrationID," + + "creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); anydata[]? generatedKeys = ret.generatedKeys["CUSTOMERID"]; int key1 = -1; int key2 = -1; @@ -95,8 +95,8 @@ function testBatchUpdateWithValues(string jdbcURL) returns int[] { //Batch 2 myBatchType?[] parameters2 = ["John", "Gates", 45, 2400.5, "NY"]; - jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (firstName,lastName,registrationID, - creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); + jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (firstName,lastName,registrationID," + + "creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); checkpanic testDB.stop(); return ret.updatedRowCount; } @@ -121,8 +121,8 @@ function testBatchUpdateWithVariables(string jdbcURL) returns int[] { //Batch 2 myBatchType?[] parameters2 = ["John", "Gates", 45, 2400.5, "NY"]; - jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (firstName,lastName,registrationID, - creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); + jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (firstName,lastName,registrationID," + + "creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); checkpanic testDB.stop(); return ret.updatedRowCount; } @@ -171,8 +171,8 @@ function testBatchUpdateWithFailure(string jdbcURL) returns @tainted [int[], int para5 = {sqlType: jdbc:TYPE_VARCHAR, value: "Colombo"}; jdbc:Parameter?[] parameters4 = [para0, para1, para2, para3, para4, para5]; - jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (customerId, firstName,lastName,registrationID, - creditLimit, country) values (?,?,?,?,?,?)", false, parameters1, parameters2, parameters3, parameters4); + jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (customerId, firstName,lastName,registrationID," + + "creditLimit, country) values (?,?,?,?,?,?)", false, parameters1, parameters2, parameters3, parameters4); int[] updateCount = ret.updatedRowCount; var dt = testDB->select("SELECT count(*) as countval from Customers where customerId in (111,222,333)", ResultCount); @@ -194,8 +194,8 @@ function testBatchUpdateWithNullParam(string jdbcURL) returns int[] { poolOptions: {maximumPoolSize: 1} }); - jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('Alex','Smith',20,3400.5,'Colombo')", false); + jdbc:BatchUpdateResult ret = testDB->batchUpdate("Insert into Customers (firstName,lastName,registrationID,creditLimit,country)" + + "values ('Alex','Smith',20,3400.5,'Colombo')", false); int[] updateCount = ret.updatedRowCount; checkpanic testDB.stop(); return updateCount; @@ -227,8 +227,8 @@ function testFailedBatchUpdate(string jdbcURL) returns [string, int, int] { para5 = {sqlType: jdbc:TYPE_VARCHAR, value: "Colombo"}; jdbc:Parameter?[] parameters2 = [para1, para2, para3, para4, para5]; - jdbc:BatchUpdateResult x = testDB->batchUpdate("Insert into CustData (firstName,lastName,registrationID, - creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); + jdbc:BatchUpdateResult x = testDB->batchUpdate("Insert into CustData (firstName,lastName,registrationID," + + "creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); int batch1Status = 0; int batch2Status = 0; @@ -274,8 +274,8 @@ function testErrorWithBatchUpdate(string jdbcURL) returns @tainted [string, stri para5 = {sqlType: jdbc:TYPE_VARCHAR, value: "Colombo"}; jdbc:Parameter?[] parameters2 = [para1, para2, para3, para4, para5]; - jdbc:BatchUpdateResult x = testDB->batchUpdate("Insert into CustData (firstName,lastName,registrationID,creditLimit,country) - values (?,?,?,?,?)", false, parameters1, parameters2); + jdbc:BatchUpdateResult x = testDB->batchUpdate("Insert into CustData (firstName,lastName,registrationID,creditLimit,country)" + + "values (?,?,?,?,?)", false, parameters1, parameters2); string returnVal = ""; int[] updateCount = x.updatedRowCount; diff --git a/stdlib/jdbc/src/test/resources/test-src/actions/h2_actions_test.bal b/stdlib/jdbc/src/test/resources/test-src/actions/h2_actions_test.bal index 24ae7d235ddf..eed154907b02 100644 --- a/stdlib/jdbc/src/test/resources/test-src/actions/h2_actions_test.bal +++ b/stdlib/jdbc/src/test/resources/test-src/actions/h2_actions_test.bal @@ -62,8 +62,8 @@ function testUpdate(string jdbcURL) returns int { poolOptions: {maximumPoolSize: 1} }); - var insertCountRet = testDB->update("insert into Customers (customerId, name, creditLimit, country) - values (15, 'Anne', 1000, 'UK')"); + var insertCountRet = testDB->update("insert into Customers (customerId, name, creditLimit, country)" + + "values (15, 'Anne', 1000, 'UK')"); int insertCount = 0; if (insertCountRet is jdbc:UpdateResult) { insertCount = insertCountRet.updatedRowCount; @@ -163,11 +163,11 @@ function testUpdateInMemory(string jdbcURL) returns @tainted [int, string] { poolOptions: {maximumPoolSize: 1} }); - _ = checkpanic testDB->update("CREATE TABLE Customers2(customerId INTEGER NOT NULL IDENTITY,name VARCHAR(300), - creditLimit DOUBLE, country VARCHAR(300), PRIMARY KEY (customerId))"); + _ = checkpanic testDB->update("CREATE TABLE Customers2(customerId INTEGER NOT NULL IDENTITY,name VARCHAR(300)," + + "creditLimit DOUBLE, country VARCHAR(300), PRIMARY KEY (customerId))"); - var insertCountRet = testDB->update("insert into Customers2 (customerId, name, creditLimit, country) - values (15, 'Anne', 1000, 'UK')"); + var insertCountRet = testDB->update("insert into Customers2 (customerId, name, creditLimit, country) " + + "values (15, 'Anne', 1000, 'UK')"); int insertCount = 0; if (insertCountRet is jdbc:UpdateResult) { insertCount = insertCountRet.updatedRowCount; diff --git a/stdlib/jdbc/src/test/resources/test-src/actions/select_test.bal b/stdlib/jdbc/src/test/resources/test-src/actions/select_test.bal index d3ef950c0d44..6b7ac68b8a51 100644 --- a/stdlib/jdbc/src/test/resources/test-src/actions/select_test.bal +++ b/stdlib/jdbc/src/test/resources/test-src/actions/select_test.bal @@ -52,8 +52,8 @@ function testSelectNumericData(string jdbcURL) returns [int, int, int, int, int, poolOptions: {maximumPoolSize: 1} }); - var result = testDB->select("SELECT int_type, bigint_type, smallint_type, tinyint_type, bit_type, decimal_type, - numeric_type, float_type, real_type from NumericTypes where id = 1", NumericData); + var result = testDB->select("SELECT int_type, bigint_type, smallint_type, tinyint_type, bit_type, decimal_type," + + "numeric_type, float_type, real_type from NumericTypes where id = 1", NumericData); int intType = -1; int bigintType = -1; @@ -182,8 +182,8 @@ function testArrayOfQueryParameters(string jdbcURL) returns string { jdbc:Parameter para3 = {sqlType: jdbc:TYPE_DOUBLE, value: doubleArray}; jdbc:Parameter para4 = {sqlType: jdbc:TYPE_DOUBLE, value: decimalArray}; - var dt = testDB->select("SELECT FirstName from Customers where FirstName = ? or lastName = 'A' or - lastName = '\"BB\"' or registrationID in(?) or lastName in(?) or creditLimit in(?) or creditLimit in (?)", + var dt = testDB->select("SELECT FirstName from Customers where FirstName = ? or lastName = 'A' or " + + "lastName = '\"BB\"' or registrationID in(?) or lastName in(?) or creditLimit in(?) or creditLimit in (?)", ResultCustomers, para0, para1, para2, para3, para4); string firstName = ""; if (dt is table) { @@ -214,8 +214,8 @@ function testBoolArrayOfQueryParameters(string jdbcURL) returns string { jdbc:Parameter para1 = {sqlType: jdbc:TYPE_BOOLEAN, value: boolDataArray}; jdbc:Parameter para2 = {sqlType: jdbc:TYPE_VARCHAR, value: stringDataArray}; - var dt = testDB->select("SELECT firstName from Customers where customerId = ? and visaAccepted in(?) and - firstName in (?)", ResultCustomers, 1, para1, para2); + var dt = testDB->select("SELECT firstName from Customers where customerId = ? and visaAccepted in(?) and " + + "firstName in (?)", ResultCustomers, 1, para1, para2); string firstName = ""; if (dt is table) { foreach var x in dt { diff --git a/stdlib/jdbc/src/test/resources/test-src/actions/update_test.bal b/stdlib/jdbc/src/test/resources/test-src/actions/update_test.bal index 41653b803f13..2dafde948b63 100644 --- a/stdlib/jdbc/src/test/resources/test-src/actions/update_test.bal +++ b/stdlib/jdbc/src/test/resources/test-src/actions/update_test.bal @@ -356,10 +356,10 @@ function testInsertNumericDataWithParameters(string jdbcURL) returns [int, int, jdbc:Parameter para8 = {sqlType: jdbc:TYPE_FLOAT, value: 5000.77, direction: jdbc:DIRECTION_IN}; jdbc:Parameter para9 = {sqlType: jdbc:TYPE_REAL, value: 5000.78, direction: jdbc:DIRECTION_IN}; - var result = testDB->update("Insert into NumericTypes (int_type, bigint_type, smallint_type, tinyint_type, - bit_type, decimal_type, numeric_type, float_type, real_type) - values (?,?,?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, - para6, para7, para8, para9); + var result = testDB->update("Insert into NumericTypes (int_type, bigint_type, smallint_type, tinyint_type," + + "bit_type, decimal_type, numeric_type, float_type, real_type) " + + "values (?,?,?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, + para6, para7, para8, para9); int insertCount = 0; int generatedKey = -1; if (result is jdbc:UpdateResult) { @@ -368,9 +368,9 @@ function testInsertNumericDataWithParameters(string jdbcURL) returns [int, int, } jdbc:Parameter p1 = {sqlType: jdbc:TYPE_INTEGER, value: generatedKey}; - var dt = testDB->select("SELECT int_type, bigint_type, smallint_type, tinyint_type, - bit_type, decimal_type, numeric_type, float_type, real_type from - NumericTypes where id = ?", NumericData, generatedKey); + var dt = testDB->select("SELECT int_type, bigint_type, smallint_type, tinyint_type," + + "bit_type, decimal_type, numeric_type, float_type, real_type from " + + "NumericTypes where id = ?", NumericData, generatedKey); int intType = -1; int bigintType = -1; int smallintType = -1; @@ -408,9 +408,9 @@ function testInsertNumericDataWithDirectValues(string jdbcURL) returns [int, int poolOptions: {maximumPoolSize: 1} }); - var result = testDB->update("Insert into NumericTypes (int_type, bigint_type, smallint_type, tinyint_type, - bit_type, decimal_type, numeric_type, float_type, real_type) - values (?,?,?,?,?,?,?,?,?)", -2147483648, -2147483650, -32768, 0, + var result = testDB->update("Insert into NumericTypes (int_type, bigint_type, smallint_type, tinyint_type," + + "bit_type, decimal_type, numeric_type, float_type, real_type) " + + "values (?,?,?,?,?,?,?,?,?)", -2147483648, -2147483650, -32768, 0, false, -5000.75, -5000.76, -5000.77, -5000.78); int insertCount = 0; int generatedKey = -1; @@ -419,9 +419,9 @@ function testInsertNumericDataWithDirectValues(string jdbcURL) returns [int, int generatedKey = result.generatedKeys["ID"]; } - var dt = testDB->select("SELECT int_type, bigint_type, smallint_type, tinyint_type, - bit_type, decimal_type, numeric_type, float_type, real_type from - NumericTypes where id = ?", NumericData, generatedKey); + var dt = testDB->select("SELECT int_type, bigint_type, smallint_type, tinyint_type," + + "bit_type, decimal_type, numeric_type, float_type, real_type from " + + "NumericTypes where id = ?", NumericData, generatedKey); int intType = -1; int bigintType = -1; int smallintType = -1; @@ -469,9 +469,9 @@ function testInsertNumericDataWithNilValues(string jdbcURL) returns [int?, int?, jdbc:Parameter para8 = {sqlType: jdbc:TYPE_FLOAT, value: (), direction: jdbc:DIRECTION_IN}; jdbc:Parameter para9 = {sqlType: jdbc:TYPE_REAL, value: (), direction: jdbc:DIRECTION_IN}; - var result = testDB->update("Insert into NumericTypes (int_type, bigint_type, smallint_type, tinyint_type, - bit_type, decimal_type, numeric_type, float_type, real_type) - values (?,?,?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, + var result = testDB->update("Insert into NumericTypes (int_type, bigint_type, smallint_type, tinyint_type," + + "bit_type, decimal_type, numeric_type, float_type, real_type) " + + "values (?,?,?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, para6, para7, para8, para9); int insertCount = 0; int generatedKey = -1; @@ -480,9 +480,9 @@ function testInsertNumericDataWithNilValues(string jdbcURL) returns [int?, int?, generatedKey = result.generatedKeys["ID"]; } - var dt = testDB->select("SELECT int_type, bigint_type, smallint_type, tinyint_type, - bit_type, decimal_type, numeric_type, float_type, real_type from - NumericTypes where id = ?", NumericDataWithNil, generatedKey); + var dt = testDB->select("SELECT int_type, bigint_type, smallint_type, tinyint_type," + + "bit_type, decimal_type, numeric_type, float_type, real_type from " + + "NumericTypes where id = ?", NumericDataWithNil, generatedKey); int? intType = -1; int? bigintType = -1; int? smallintType = -1; @@ -531,18 +531,18 @@ function testInsertStringDataWithParameters(string jdbcURL) returns [int, string jdbc:Parameter para8 = {sqlType: jdbc:TYPE_LONGNVARCHAR, value: "test5", direction: jdbc:DIRECTION_IN}; jdbc:Parameter para9 = {sqlType: jdbc:TYPE_CLOB, value: "hello ballerina code", direction: jdbc:DIRECTION_IN}; - var result = testDB->update("Insert into StringTypes (id, varchar_type, charmax_type, char_type, - charactermax_type, character_type, nvarcharmax_type, - longvarchar_type, clob_type) values (?,?,?,?,?,?,?,?,?)", + var result = testDB->update("Insert into StringTypes (id, varchar_type, charmax_type, char_type," + + "charactermax_type, character_type, nvarcharmax_type," + + "longvarchar_type, clob_type) values (?,?,?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, para6, para7, para8, para9); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT varchar_type, charmax_type, char_type, charactermax_type, character_type, - nvarcharmax_type, longvarchar_type, clob_type from - StringTypes where id = ?", StringData, intIDVal); + var dt = testDB->select("SELECT varchar_type, charmax_type, char_type, charactermax_type, character_type," + + "nvarcharmax_type, longvarchar_type, clob_type from " + + "StringTypes where id = ?", StringData, intIDVal); string varcharType = ""; string charmaxType = ""; string charType = ""; @@ -580,9 +580,9 @@ function testInsertStringDataWithDirectParams(string jdbcURL) returns [int, stri int intIDVal = 25; - var result = testDB->update("Insert into StringTypes (id, varchar_type, charmax_type, char_type, - charactermax_type, character_type, nvarcharmax_type, - longvarchar_type, clob_type) values (?,?,?,?,?,?,?,?,?)", + var result = testDB->update("Insert into StringTypes (id, varchar_type, charmax_type, char_type," + + "charactermax_type, character_type, nvarcharmax_type," + + "longvarchar_type, clob_type) values (?,?,?,?,?,?,?,?,?)", intIDVal, "str1", "str2", "A", "str3", "B", "str4", "str5", "hello ballerina code"); int insertCount = 0; @@ -590,9 +590,9 @@ function testInsertStringDataWithDirectParams(string jdbcURL) returns [int, stri insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT varchar_type, charmax_type, char_type, charactermax_type, character_type, - nvarcharmax_type, longvarchar_type, clob_type from - StringTypes where id = ?", StringData, intIDVal); + var dt = testDB->select("SELECT varchar_type, charmax_type, char_type, charactermax_type, character_type," + + "nvarcharmax_type, longvarchar_type, clob_type from " + + "StringTypes where id = ?", StringData, intIDVal); string varcharType = ""; string charmaxType = ""; string charType = ""; @@ -638,18 +638,18 @@ function testInsertStringDataWithNilValues(string jdbcURL) returns [int, string? jdbc:Parameter para8 = {sqlType: jdbc:TYPE_LONGNVARCHAR, value: (), direction: jdbc:DIRECTION_IN}; jdbc:Parameter para9 = {sqlType: jdbc:TYPE_CLOB, value: (), direction: jdbc:DIRECTION_IN}; - var result = testDB->update("Insert into StringTypes (id, varchar_type, charmax_type, char_type, - charactermax_type, character_type, nvarcharmax_type, - longvarchar_type, clob_type) values (?,?,?,?,?,?,?,?,?)", + var result = testDB->update("Insert into StringTypes (id, varchar_type, charmax_type, char_type," + + "charactermax_type, character_type, nvarcharmax_type," + + "longvarchar_type, clob_type) values (?,?,?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, para6, para7, para8, para9); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT varchar_type, charmax_type, char_type, charactermax_type, character_type, - nvarcharmax_type, longvarchar_type, clob_type from - StringTypes where id = ?", StringDataWithNil, 26); + var dt = testDB->select("SELECT varchar_type, charmax_type, char_type, charactermax_type, character_type," + + "nvarcharmax_type, longvarchar_type, clob_type from " + + "StringTypes where id = ?", StringDataWithNil, 26); string? varcharType = ""; string? charmaxType = ""; string? charType = ""; @@ -687,18 +687,18 @@ function testInsertStringDataWithEmptyValues(string jdbcURL) returns [int, strin int intIDVal = 27; - var result = testDB->update("Insert into StringTypes (id, varchar_type, charmax_type, char_type, - charactermax_type, character_type, nvarcharmax_type, - longvarchar_type, clob_type) values (?,?,?,?,?,?,?,?,?)", + var result = testDB->update("Insert into StringTypes (id, varchar_type, charmax_type, char_type," + + "charactermax_type, character_type, nvarcharmax_type," + + "longvarchar_type, clob_type) values (?,?,?,?,?,?,?,?,?)", intIDVal, "", "", "", "", "", "", "", ""); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT varchar_type, charmax_type, char_type, charactermax_type, character_type, - nvarcharmax_type, longvarchar_type, clob_type from - StringTypes where id = ?", StringData, intIDVal); + var dt = testDB->select("SELECT varchar_type, charmax_type, char_type, charactermax_type, character_type," + + "nvarcharmax_type, longvarchar_type, clob_type from " + + "StringTypes where id = ?", StringData, intIDVal); string varcharType = "a"; string charmaxType = "a"; string charType = "a"; @@ -890,17 +890,17 @@ function testInsertBinaryDataWithParameters(string jdbcURL) returns [int, byte[] jdbc:Parameter para6 = {sqlType: jdbc:TYPE_BINARY, value: "YmxvYiBkYXRh"}; jdbc:Parameter para7 = {sqlType: jdbc:TYPE_BINARY, value: "YmxvYiBkYXRh"}; - var result = testDB->update("Insert into BinaryTypes (id, binary_type, varbinary_type, blob_type, - longvarbinary_type, binaryvarying_type, binarylargetobj_type) - values (?,?,?,?,?,?,?)", + var result = testDB->update("Insert into BinaryTypes (id, binary_type, varbinary_type, blob_type," + + "longvarbinary_type, binaryvarying_type, binarylargetobj_type) " + + "values (?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, para6, para7); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT binary_type, varbinary_type, blob_type, longvarbinary_type, binaryvarying_type, - binarylargetobj_type from BinaryTypes where id = ?", BinaryData, 11); + var dt = testDB->select("SELECT binary_type, varbinary_type, blob_type, longvarbinary_type, binaryvarying_type," + + "binarylargetobj_type from BinaryTypes where id = ?", BinaryData, 11); byte[] binaryType = []; byte[] varbinaryType = []; byte[] blobType = []; @@ -940,17 +940,17 @@ function testInsertBinaryDataWithNilValues(string jdbcURL) returns [int, byte[]? jdbc:Parameter para6 = {sqlType: jdbc:TYPE_BINARY, value: ()}; jdbc:Parameter para7 = {sqlType: jdbc:TYPE_BINARY, value: ()}; - var result = testDB->update("Insert into BinaryTypes (id, binary_type, varbinary_type, blob_type, - longvarbinary_type, binaryvarying_type, binarylargetobj_type) - values (?,?,?,?,?,?,?)", + var result = testDB->update("Insert into BinaryTypes (id, binary_type, varbinary_type, blob_type," + + "longvarbinary_type, binaryvarying_type, binarylargetobj_type) " + + "values (?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, para6, para7); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT binary_type, varbinary_type, blob_type, longvarbinary_type, binaryvarying_type, - binarylargetobj_type from BinaryTypes where id = ?", BinaryDataWithNil, 12); + var dt = testDB->select("SELECT binary_type, varbinary_type, blob_type, longvarbinary_type, binaryvarying_type," + + "binarylargetobj_type from BinaryTypes where id = ?", BinaryDataWithNil, 12); byte[]? binaryType = []; byte[]? varbinaryType = []; byte[]? blobType = []; @@ -990,17 +990,17 @@ function testInsertTimeDataAsString(string jdbcURL) returns [int, string, string jdbc:Parameter para6 = {sqlType: jdbc:TYPE_TIME, value: "20:08:08.034900-08:00"}; jdbc:Parameter para7 = {sqlType: jdbc:TYPE_TIMESTAMP, value: "2019-08-09T20:08:08.034900-08:00"}; - var result = testDB->update("Insert into TimeTypes (id, date_type, timenz_type, timestampnz_type, - datetime_type, timez_type, timestampz_type) - values (?,?,?,?,?,?,?)", + var result = testDB->update("Insert into TimeTypes (id, date_type, timenz_type, timestampnz_type," + + "datetime_type, timez_type, timestampz_type) " + + "values (?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, para6, para7); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT date_type, timenz_type, timestampnz_type, datetime_type, timez_type, timestampz_type - from TimeTypes where id = ?", TimeDataAsString, 11); + var dt = testDB->select("SELECT date_type, timenz_type, timestampnz_type, datetime_type, timez_type, timestampz_type " + + "from TimeTypes where id = ?", TimeDataAsString, 11); string dateType = ""; string timenzType = ""; string timestampnzType = ""; @@ -1071,17 +1071,17 @@ function testInsertTimeDataAsBallerinaTime(string jdbcURL) returns [int, boolean jdbc:Parameter para6 = {sqlType: jdbc:TYPE_TIME, value: timeValWithZoneVal}; jdbc:Parameter para7 = {sqlType: jdbc:TYPE_TIMESTAMP, value: timeStampValWithZoneVal}; - var result = testDB->update("Insert into TimeTypes (id, date_type, timenz_type, timestampnz_type, - datetime_type, timez_type, timestampz_type) - values (?,?,?,?,?,?,?)", + var result = testDB->update("Insert into TimeTypes (id, date_type, timenz_type, timestampnz_type," + + "datetime_type, timez_type, timestampz_type)" + + "values (?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, para6, para7); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT date_type, timenz_type, timestampnz_type, datetime_type, timez_type, timestampz_type - from TimeTypes where id = ?", TimeDataAsTime, 12); + var dt = testDB->select("SELECT date_type, timenz_type, timestampnz_type, datetime_type, timez_type, timestampz_type " + + "from TimeTypes where id = ?", TimeDataAsTime, 12); boolean dateEquals = false; boolean timeEquals = false; @@ -1129,17 +1129,16 @@ function testInsertTimeDataAsInt(string jdbcURL) returns [int, int, int, int] { jdbc:Parameter para3 = {sqlType: jdbc:TYPE_TIMESTAMP, value: 1565381288}; jdbc:Parameter para4 = {sqlType: jdbc:TYPE_DATETIME, value: 1565381288}; - var result = testDB->update("Insert into TimeTypes (id, timenz_type, timestampnz_type, - datetime_type) - values (?,?,?,?)", + var result = testDB->update("Insert into TimeTypes (id, timenz_type, timestampnz_type," + + "datetime_type) values (?,?,?,?)", para1, para2, para3, para4); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT timenz_type, timestampnz_type, datetime_type - from TimeTypes where id = ?", TimeDataAsInt, 13); + var dt = testDB->select("SELECT timenz_type, timestampnz_type, datetime_type " + + "from TimeTypes where id = ?", TimeDataAsInt, 13); int timenzType = -1; int timestampnzType = -1; @@ -1175,17 +1174,17 @@ function testInsertTimeDataAsBallerinaTimeWithNil(string jdbcURL) returns [int, jdbc:Parameter para6 = {sqlType: jdbc:TYPE_TIME, value: ()}; jdbc:Parameter para7 = {sqlType: jdbc:TYPE_TIMESTAMP, value: ()}; - var result = testDB->update("Insert into TimeTypes (id, date_type, timenz_type, timestampnz_type, - datetime_type, timez_type, timestampz_type) - values (?,?,?,?,?,?,?)", + var result = testDB->update("Insert into TimeTypes (id, date_type, timenz_type, timestampnz_type," + + "datetime_type, timez_type, timestampz_type) " + + "values (?,?,?,?,?,?,?)", para1, para2, para3, para4, para5, para6, para7); int insertCount = 0; if (result is jdbc:UpdateResult) { insertCount = result.updatedRowCount; } - var dt = testDB->select("SELECT date_type, timenz_type, timestampnz_type, datetime_type, timez_type, timestampz_type - from TimeTypes where id = ?", TimeDataWithNil, 14); + var dt = testDB->select("SELECT date_type, timenz_type, timestampnz_type, datetime_type, timez_type, timestampz_type " + + "from TimeTypes where id = ?", TimeDataWithNil, 14); time:Time currentTime = time:currentTime(); diff --git a/stdlib/jdbc/src/test/resources/test-src/table/table_type_test.bal b/stdlib/jdbc/src/test/resources/test-src/table/table_type_test.bal index 8b5f9796b418..d1665d267c1a 100644 --- a/stdlib/jdbc/src/test/resources/test-src/table/table_type_test.bal +++ b/stdlib/jdbc/src/test/resources/test-src/table/table_type_test.bal @@ -163,8 +163,8 @@ function testToJson(string jdbcURL) returns @tainted json { poolOptions: {maximumPoolSize: 1} }); - var result = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 1", ()); + var result = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 1", ()); json retVal = getJsonConversionResult(result); checkpanic testDB.stop(); return retVal; @@ -206,8 +206,8 @@ function testToXml(string jdbcURL) returns xml { poolOptions: {maximumPoolSize: 1} }); - var result = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 1", ()); + var result = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 1", ()); xml retVal = getXMLConversionResult(result); checkpanic testDB.stop(); return retVal; @@ -251,8 +251,8 @@ function testToXmlMultipleConsume(string jdbcURL) returns xml { poolOptions: {maximumPoolSize: 1} }); - var result = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 1", ()); + var result = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 1", ()); xml retVal = getXMLConversionResult(result); checkpanic testDB.stop(); @@ -291,8 +291,8 @@ function testToJsonMultipleConsume(string jdbcURL) returns @tainted json { poolOptions: {maximumPoolSize: 1} }); - var tableOrError = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 1", ()); + var tableOrError = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 1", ()); json result = getJsonConversionResult(tableOrError); checkpanic testDB.stop(); @@ -306,9 +306,9 @@ function toXmlComplex(string jdbcURL) returns xml { password: "", poolOptions: {maximumPoolSize: 1} }); - var tableOrError = testDB->select("SELECT int_type, int_array, long_type, long_array, float_type, - float_array, double_type, boolean_type, string_type, decimal_type, double_array, boolean_array, - string_array from MixTypes where row_id =1", ()); + var tableOrError = testDB->select("SELECT int_type, int_array, long_type, long_array, float_type," + + "float_array, double_type, boolean_type, string_type, decimal_type, double_array, boolean_array," + + "string_array from MixTypes where row_id =1", ()); xml convertedVal = getXMLConversionResult(tableOrError); checkpanic testDB.stop(); @@ -323,9 +323,9 @@ function testToXmlComplexWithStructDef(string jdbcURL) returns xml { poolOptions: {maximumPoolSize: 1} }); - var tableOrError = testDB->select("SELECT int_type, int_array, long_type, long_array, float_type, - float_array, double_type, boolean_type, string_type, double_array, boolean_array, string_array - from MixTypes where row_id =1", TestTypeData); + var tableOrError = testDB->select("SELECT int_type, int_array, long_type, long_array, float_type," + + "float_array, double_type, boolean_type, string_type, double_array, boolean_array, string_array " + + "from MixTypes where row_id =1", TestTypeData); xml convertedVal = getXMLConversionResult(tableOrError); checkpanic testDB.stop(); @@ -339,9 +339,9 @@ function testToJsonComplex(string jdbcURL) returns @tainted json { password: "", poolOptions: {maximumPoolSize: 1} }); - var tableOrError = testDB->select("SELECT int_type, int_array, long_type, long_array, float_type, - float_array, double_type, boolean_type, string_type, decimal_type, double_array, boolean_array, string_array - from MixTypes where row_id =1", ()); + var tableOrError = testDB->select("SELECT int_type, int_array, long_type, long_array, float_type," + + "float_array, double_type, boolean_type, string_type, decimal_type, double_array, boolean_array, string_array " + + "from MixTypes where row_id =1", ()); json convertedVal = getJsonConversionResult(tableOrError); checkpanic testDB.stop(); @@ -357,9 +357,9 @@ function testToJsonComplexWithStructDef(string jdbcURL) returns @tainted json { poolOptions: {maximumPoolSize: 1} }); - var tableOrError = testDB->select("SELECT int_type, int_array, long_type, long_array, float_type, - float_array, double_type, boolean_type, string_type, double_array, boolean_array, string_array - from MixTypes where row_id =1", TestTypeData); + var tableOrError = testDB->select("SELECT int_type, int_array, long_type, long_array, float_type," + + "float_array, double_type, boolean_type, string_type, double_array, boolean_array, string_array " + + "from MixTypes where row_id =1", TestTypeData); json ret = getJsonConversionResult(tableOrError); checkpanic testDB.stop(); return ret; @@ -372,8 +372,8 @@ function testJsonWithNull(string jdbcURL) returns @tainted json { password: "", poolOptions: {maximumPoolSize: 1} }); - var tableOrError = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 2", ()); + var tableOrError = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 2", ()); json convertedVal = getJsonConversionResult(tableOrError); checkpanic testDB.stop(); return convertedVal; @@ -386,8 +386,8 @@ function testXmlWithNull(string jdbcURL) returns xml { password: "", poolOptions: {maximumPoolSize: 1} }); - var tableOrError = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 2", ()); + var tableOrError = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 2", ()); xml ret = getXMLConversionResult(tableOrError); checkpanic testDB.stop(); return ret; @@ -452,8 +452,8 @@ function testGetPrimitiveTypes(string jdbcURL) returns @tainted [int, int, float boolean b = false; string s = ""; decimal dec = -1; - var dtRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type, decimal_type from DataTable WHERE row_id = 1", ResultPrimitive); + var dtRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type, decimal_type from DataTable WHERE row_id = 1", ResultPrimitive); if (dtRet is table) { while (dtRet.hasNext()) { var rs = dtRet.getNext(); @@ -506,8 +506,8 @@ function testArrayData(string jdbcURL) returns @tainted [int[], int[], decimal[] poolOptions: {maximumPoolSize: 1} }); - var tableOrError = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 1", ResultMap); + var tableOrError = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 1", ResultMap); int[] int_arr = []; int[] long_arr = []; decimal[] float_arr = []; @@ -555,8 +555,8 @@ function testArrayDataInsertAndPrint(string jdbcURL) returns @tainted [int, int, int boolArrLen = -1; int strArrLen = -1; - var updateRet = testDB->update("insert into ArrayTypes(row_id, int_array, long_array, float_array, - string_array, boolean_array) values (?,?,?,?,?,?)", + var updateRet = testDB->update("insert into ArrayTypes(row_id, int_array, long_array, float_array," + + "string_array, boolean_array) values (?,?,?,?,?,?)", paraID, paraInt, paraLong, paraFloat, paraString, paraBool); int updatedCount = -1; if (updateRet is jdbc:UpdateResult) { @@ -565,8 +565,8 @@ function testArrayDataInsertAndPrint(string jdbcURL) returns @tainted [int, int, error e = updateRet; io:println(e.detail()["message"]); } - var dtRet = testDB->select("SELECT int_array, long_array, float_array, boolean_array, string_array - from ArrayTypes where row_id = 4", ResultMap); + var dtRet = testDB->select("SELECT int_array, long_array, float_array, boolean_array, string_array " + + "from ArrayTypes where row_id = 4", ResultMap); if (dtRet is table) { while (dtRet.hasNext()) { var rs = dtRet.getNext(); @@ -606,12 +606,12 @@ function testDateTime(int datein, int timein, int timestampin, string jdbcURL) r jdbc:Parameter para3 = {sqlType: jdbc:TYPE_TIMESTAMP, value: timestampin}; jdbc:Parameter para4 = {sqlType: jdbc:TYPE_DATETIME, value: timestampin}; - _ = checkpanic testDB->update("Insert into DateTimeTypes - (row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", + _ = checkpanic testDB->update("Insert into DateTimeTypes " + + "(row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", para0, para1, para2, para3, para4); - var selectRet = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type - from DateTimeTypes where row_id = 1", ResultDates); + var selectRet = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type " + + "from DateTimeTypes where row_id = 1", ResultDates); if (selectRet is table) { while (selectRet.hasNext()) { var rs = selectRet.getNext(); @@ -662,12 +662,12 @@ function testDateTimeAsTimeStruct(string jdbcURL) returns @tainted [int, int, in jdbc:Parameter para3 = {sqlType: jdbc:TYPE_TIMESTAMP, value: timestampStruct}; jdbc:Parameter para4 = {sqlType: jdbc:TYPE_DATETIME, value: datetimeStruct}; - _ = checkpanic testDB->update("Insert into DateTimeTypes - (row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", + _ = checkpanic testDB->update("Insert into DateTimeTypes " + + "(row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", para0, para1, para2, para3, para4); - var selectRet = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type - from DateTimeTypes where row_id = 31", ResultDatesStruct); + var selectRet = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type " + + "from DateTimeTypes where row_id = 31", ResultDatesStruct); if (selectRet is table) { while (selectRet.hasNext()) { var rs = selectRet.getNext(); @@ -703,12 +703,12 @@ function testDateTimeInt(int datein, int timein, int timestampin, string jdbcURL int timestamp = -1; int datetime = -1; - _ = checkpanic testDB->update("Insert into DateTimeTypes - (row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", + _ = checkpanic testDB->update("Insert into DateTimeTypes " + + "(row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", para0, para1, para2, para3, para4); - var selectRet = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type - from DateTimeTypes where row_id = 32", ResultDatesInt); + var selectRet = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type " + + "from DateTimeTypes where row_id = 32", ResultDatesInt); if (selectRet is table) { while (selectRet.hasNext()) { @@ -761,9 +761,9 @@ function testColumnAlias(string jdbcURL) returns @tainted [int, int, float, floa boolean b = false; string s = ""; int i2 = -1; - var selectRet = testDB->select("SELECT dt1.int_type, dt1.long_type, dt1.float_type, - dt1.double_type,dt1.boolean_type, dt1.string_type,dt2.int_type as dt2int_type from DataTable dt1 - left join DataTableRep dt2 on dt1.row_id = dt2.row_id WHERE dt1.row_id = 1;", ResultSetTestAlias); + var selectRet = testDB->select("SELECT dt1.int_type, dt1.long_type, dt1.float_type," + + "dt1.double_type,dt1.boolean_type, dt1.string_type,dt2.int_type as dt2int_type from DataTable dt1 " + + "left join DataTableRep dt2 on dt1.row_id = dt2.row_id WHERE dt1.row_id = 1;", ResultSetTestAlias); if (selectRet is table) { while (selectRet.hasNext()) { var rs = selectRet.getNext(); @@ -828,13 +828,13 @@ function testTableAutoClose(string jdbcURL) returns @tainted [int, json] { } } } - var selectRet2 = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 1", ()); + var selectRet2 = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 1", ()); json jsonData = getJsonConversionResult(selectRet2); - var selectRet3 = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 1", ()); + var selectRet3 = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 1", ()); if (selectRet3 is table) { selectRet3.close(); } @@ -927,8 +927,8 @@ function testTablePrintAndPrintln(string jdbcURL) { password: "", poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 1", ()); + var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 1", ()); if (selectRet is table) { io:println(selectRet); io:print(selectRet); @@ -1122,8 +1122,8 @@ function testGetFloatTypes(string jdbcURL) returns @tainted [float, float, decim poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT float_type, double_type, - numeric_type, decimal_type from FloatTable WHERE row_id = 1", ResultSetFloat); + var selectRet = testDB->select("SELECT float_type, double_type," + + "numeric_type, decimal_type from FloatTable WHERE row_id = 1", ResultSetFloat); float f = 0; float d = 0; @@ -1302,12 +1302,12 @@ function testJsonXMLConversionwithDuplicateColumnNames(string jdbcURL) returns @ password: "", poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT dt1.row_id, dt1.int_type, dt2.row_id, dt2.int_type from DataTable dt1 left - join DataTableRep dt2 on dt1.row_id = dt2.row_id WHERE dt1.row_id = 1", ()); + var selectRet = testDB->select("SELECT dt1.row_id, dt1.int_type, dt2.row_id, dt2.int_type from DataTable dt1 left " + + "join DataTableRep dt2 on dt1.row_id = dt2.row_id WHERE dt1.row_id = 1", ()); json j = getJsonConversionResult(selectRet); - var selectRet2 = testDB->select("SELECT dt1.row_id, dt1.int_type, dt2.row_id, dt2.int_type from DataTable dt1 left - join DataTableRep dt2 on dt1.row_id = dt2.row_id WHERE dt1.row_id = 1", ()); + var selectRet2 = testDB->select("SELECT dt1.row_id, dt1.int_type, dt2.row_id, dt2.int_type from DataTable dt1 left " + + "join DataTableRep dt2 on dt1.row_id = dt2.row_id WHERE dt1.row_id = 1", ()); xml x = getXMLConversionResult(selectRet2); checkpanic testDB.stop(); @@ -1339,8 +1339,8 @@ function testStructFieldNotMatchingColumnName(string jdbcURL) returns @tainted [ } } - var selectRet2 = testDB->select("SELECT dt1.row_id, dt1.int_type, dt2.row_id, dt2.int_type from DataTable dt1 left - join DataTableRep dt2 on dt1.row_id = dt2.row_id WHERE dt1.row_id = 1", ResultTest); + var selectRet2 = testDB->select("SELECT dt1.row_id, dt1.int_type, dt2.row_id, dt2.int_type from DataTable dt1 left " + + "join DataTableRep dt2 on dt1.row_id = dt2.row_id WHERE dt1.row_id = 1", ResultTest); if (selectRet2 is table) { while (selectRet2.hasNext()) { @@ -1365,8 +1365,8 @@ function testGetPrimitiveTypesWithForEach(string jdbcURL) returns @tainted [int, poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type, decimal_type from DataTable WHERE row_id = 1", ResultPrimitive); + var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type, decimal_type from DataTable WHERE row_id = 1", ResultPrimitive); int i = -1; int l = -1; @@ -1425,8 +1425,8 @@ function testGetPrimitiveTypesWithWhileLoopAndConstructFrom(string jdbcURL) retu poolOptions: { maximumPoolSize: 1 } }); - var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type, decimal_type from DataTable WHERE row_id = 1", ResultPrimitive); + var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type, decimal_type from DataTable WHERE row_id = 1", ResultPrimitive); int i = -1; int l = -1; @@ -1529,8 +1529,8 @@ function testToJsonAndAccessFromMiddle(string jdbcURL) returns @tainted [json, i password: "", poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable", ()); + var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable", ()); json result = getJsonConversionResult(selectRet); json[] jArray = result; json j = jArray[1]; @@ -1545,8 +1545,8 @@ function testToJsonAndIterate(string jdbcURL) returns @tainted [json, int] | err password: "", poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable", ()); + var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable", ()); json result = getJsonConversionResult(selectRet); json[] j = result; checkpanic testDB.stop(); @@ -1560,8 +1560,8 @@ function testToJsonAndSetAsChildElement(string jdbcURL) returns @tainted json { password: "", poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable", ()); + var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable", ()); json result = getJsonConversionResult(selectRet); json j = {status: "SUCCESS", resp: {value: result}}; checkpanic testDB.stop(); @@ -1575,8 +1575,8 @@ function testToJsonAndLengthof(string jdbcURL) returns @tainted [int, int] { password: "", poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable", ()); + var selectRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable", ()); json result = getJsonConversionResult(selectRet); json[] jArray = checkpanic json[].constructFrom(result); @@ -1672,8 +1672,8 @@ function testTypeCheckingConstrainedCursorTableWithClosedConstraint(string jdbcU float d = -1; boolean b = false; string s = ""; - var dtRet = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type from DataTable WHERE row_id = 1", ResultClosed); + var dtRet = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type from DataTable WHERE row_id = 1", ResultClosed); if (dtRet is table) { while (dtRet.hasNext()) { var rs = dtRet.getNext(); diff --git a/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_negative.bal b/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_negative.bal index 04eec884db65..3fb1df14afef 100644 --- a/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_negative.bal +++ b/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_negative.bal @@ -36,33 +36,33 @@ type ResultBlobCorrectOrderWrongType record { }; function testWrongOrderInt(string jdbcURL) returns @tainted error? { - return testWrongOrder("SELECT int_type, long_type, float_type, boolean_type, string_type, double_type from DataTable - WHERE row_id = 1", jdbcURL); + return testWrongOrder("SELECT int_type, long_type, float_type, boolean_type, string_type, double_type from DataTable " + + "WHERE row_id = 1", jdbcURL); } function testWrongOrderString(string jdbcURL) returns @tainted error? { - return testWrongOrder("SELECT int_type, long_type, float_type, boolean_type, string_type, double_type from DataTable - WHERE row_id = 1", jdbcURL); + return testWrongOrder("SELECT int_type, long_type, float_type, boolean_type, string_type, double_type from DataTable " + + "WHERE row_id = 1", jdbcURL); } function testWrongOrderBoolean(string jdbcURL) returns @tainted error? { - return testWrongOrder("SELECT boolean_type, long_type, float_type, string_type, int_type, double_type from DataTable - WHERE row_id = 1", jdbcURL); + return testWrongOrder("SELECT boolean_type, long_type, float_type, string_type, int_type, double_type from DataTable " + + "WHERE row_id = 1", jdbcURL); } function testWrongOrderDouble(string jdbcURL) returns @tainted error? { - return testWrongOrder("SELECT double_type, long_type, float_type, string_type, int_type, boolean_type from DataTable - WHERE row_id = 1", jdbcURL); + return testWrongOrder("SELECT double_type, long_type, float_type, string_type, int_type, boolean_type from DataTable " + + "WHERE row_id = 1", jdbcURL); } function testWrongOrderFloat(string jdbcURL) returns @tainted error? { - return testWrongOrder("SELECT double_type, long_type, float_type, string_type, int_type, boolean_type from DataTable - WHERE row_id = 1", jdbcURL); + return testWrongOrder("SELECT double_type, long_type, float_type, string_type, int_type, boolean_type from DataTable " + + "WHERE row_id = 1", jdbcURL); } function testWrongOrderLong(string jdbcURL) returns @tainted error? { - return testWrongOrder("SELECT boolean_type, string_type, float_type, long_type, int_type, double_type from DataTable - WHERE row_id = 1", jdbcURL); + return testWrongOrder("SELECT boolean_type, string_type, float_type, long_type, int_type, double_type from DataTable " + + "WHERE row_id = 1", jdbcURL); } function testWrongOrderBlobWrongOrder(string jdbcURL) returns @tainted error? { @@ -149,8 +149,8 @@ function testLowerNoOfParams(string jdbcURL) returns @tainted error? { poolOptions: {maximumPoolSize: 1} }); - var selectRet = testDB->select("SELECT boolean_type, boolean_type, string_type, float_type, long_type, int_type, - double_type from DataTable WHERE row_id = 1", Result); + var selectRet = testDB->select("SELECT boolean_type, boolean_type, string_type, float_type, long_type, int_type," + + "double_type from DataTable WHERE row_id = 1", Result); error? retVal = (); if (selectRet is table) { diff --git a/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_nillable_mapping.bal b/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_nillable_mapping.bal index f0c25c5a3625..00062abac483 100644 --- a/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_nillable_mapping.bal +++ b/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_nillable_mapping.bal @@ -125,9 +125,9 @@ function testMappingToNillableTypeFields(string jdbcURL) returns @tainted [int?, poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type, numeric_type, decimal_type, real_type, tinyint_type, smallint_type, clob_type, - binary_type from DataTypeTableNillable where row_id=1", NillableDataTypes); + var dt = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type, numeric_type, decimal_type, real_type, tinyint_type, smallint_type, clob_type," + + "binary_type from DataTypeTableNillable where row_id=1", NillableDataTypes); int? int_type = (); int? long_type = (); @@ -175,8 +175,7 @@ function testMappingToNillableTypeFieldsBlob(string jdbcURL) returns @tainted by poolOptions: {maximumPoolSize: 1} }); byte[]? blob_type = (); - var dt = testDB->select("SELECT blob_type from DataTypeTableNillableBlob where - row_id=3", NillableBlob); + var dt = testDB->select("SELECT blob_type from DataTypeTableNillableBlob where row_id=3", NillableBlob); if (dt is table) { while (dt.hasNext()) { var rs = dt.getNext(); @@ -224,11 +223,11 @@ function testMappingDatesToNillableTimeType(string jdbcURL) returns @tainted [in jdbc:Parameter para3 = {sqlType: jdbc:TYPE_TIMESTAMP, value: timestampStruct}; jdbc:Parameter para4 = {sqlType: jdbc:TYPE_DATETIME, value: datetimeStruct}; - _ = checkpanic testDB->update("Insert into DateTimeTypes - (row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", + _ = checkpanic testDB->update("Insert into DateTimeTypes " + + "(row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", para0, para1, para2, para3, para4); - var dt = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type - from DateTimeTypes where row_id = 150", ResultDatesWithNillableTimeType); + var dt = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type " + + "from DateTimeTypes where row_id = 150", ResultDatesWithNillableTimeType); if (dt is table) { while (dt.hasNext()) { @@ -273,12 +272,12 @@ function testMappingDatesToNillableIntType(int datein, int timein, int timestamp int timestamp = -1; int datetime = -1; - _ = checkpanic testDB->update("Insert into DateTimeTypes - (row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", + _ = checkpanic testDB->update("Insert into DateTimeTypes " + + "(row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", para0, para1, para2, para3, para4); - var dt = testDB->select("SELECT date_type, time_type, timestamp_type, - datetime_type from DateTimeTypes where row_id = 151", ResultDatesWithNillableIntType); + var dt = testDB->select("SELECT date_type, time_type, timestamp_type, " + + "datetime_type from DateTimeTypes where row_id = 151", ResultDatesWithNillableIntType); if (dt is table) { while (dt.hasNext()) { @@ -314,12 +313,12 @@ function testMappingDatesToNillableStringType(int datein, int timein, int timest jdbc:Parameter para3 = {sqlType: jdbc:TYPE_TIMESTAMP, value: timestampin}; jdbc:Parameter para4 = {sqlType: jdbc:TYPE_DATETIME, value: timestampin}; - _ = checkpanic testDB->update("Insert into DateTimeTypes - (row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", + _ = checkpanic testDB->update("Insert into DateTimeTypes " + + "(row_id, date_type, time_type, timestamp_type, datetime_type) values (?,?,?,?,?)", para0, para1, para2, para3, para4); - var dt = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type - from DateTimeTypes where row_id = 152", ResultDatesWithNillableStringType); + var dt = testDB->select("SELECT date_type, time_type, timestamp_type, datetime_type " + + "from DateTimeTypes where row_id = 152", ResultDatesWithNillableStringType); if (dt is table) { while (dt.hasNext()) { @@ -345,10 +344,10 @@ function testMappingNullToNillableTypes(string jdbcURL) returns @tainted [int?, password: "", poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_type, long_type, float_type, double_type, - boolean_type, string_type, numeric_type, decimal_type, real_type, tinyint_type, smallint_type, clob_type, - binary_type, date_type, time_type, datetime_type, timestamp_type from DataTypeTableNillable where - row_id=2", NillableDataTypesAll); + var dt = testDB->select("SELECT int_type, long_type, float_type, double_type," + + "boolean_type, string_type, numeric_type, decimal_type, real_type, tinyint_type, smallint_type, clob_type," + + "binary_type, date_type, time_type, datetime_type, timestamp_type from DataTypeTableNillable where " + + "row_id=2", NillableDataTypesAll); int? int_type = (); int? long_type = (); @@ -430,8 +429,8 @@ function testMapArrayToNonNillableTypeWithNillableElementType(string jdbcURL) re poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 1", ResultMapNonNillableTypeNillableElements); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 1", ResultMapNonNillableTypeNillableElements); int?[] int_arr = []; int?[] long_arr = []; @@ -464,8 +463,8 @@ function testMapArrayToNillableTypeWithNillableElementType(string jdbcURL) retur poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 1", ResultMapNillable); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 1", ResultMapNillable); int?[]? int_arr = (); int?[]? long_arr = (); @@ -497,8 +496,8 @@ function testMapArrayToNillableTypeWithNonNillableElementType(string jdbcURL) re password: "", poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 1", ResultMapNillableTypeNonNillableElements); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 1", ResultMapNillableTypeNonNillableElements); int[]? int_arr = (); int[]? long_arr = (); @@ -531,8 +530,8 @@ function testMapNillIncludedArrayNonNillableTypeWithNillableElementType(string j poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 2", ResultMapNonNillableTypeNillableElements); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 2", ResultMapNonNillableTypeNillableElements); int?[] int_arr = []; int?[] long_arr = []; @@ -565,8 +564,8 @@ function testMapNillIncludedArrayNillableTypeWithNillableElementType(string jdbc poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 2", ResultMapNillable); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 2", ResultMapNillable); int?[]? int_arr = (); int?[]? long_arr = (); @@ -599,8 +598,8 @@ function testMapNilArrayToNillableTypeWithNonNillableElementTypes(string jdbcURL poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 3", ResultMapNillableTypeNonNillableElements); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 3", ResultMapNillableTypeNonNillableElements); int[]? int_arr = (); int[]? long_arr = (); @@ -633,8 +632,8 @@ function testMapNilArrayToNillableTypeWithNillableElementTypes(string jdbcURL) r poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 3", ResultMapNillable); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 3", ResultMapNillable); int?[]? int_arr = (); int?[]? long_arr = (); @@ -667,8 +666,8 @@ function testMapNillElementsOnlyArray(string jdbcURL) returns poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = 5", ResultMapNonNillableTypeNillableElements); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = 5", ResultMapNonNillableTypeNillableElements); int?[] int_arr = []; int?[] long_arr = []; diff --git a/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_nillable_mapping_negative.bal b/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_nillable_mapping_negative.bal index 86545f6d8f73..667dd8bd5b8c 100644 --- a/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_nillable_mapping_negative.bal +++ b/stdlib/jdbc/src/test/resources/test-src/table/table_type_test_nillable_mapping_negative.bal @@ -320,8 +320,8 @@ function testAssignNullArrayToNonNillableWithNonNillableElements(string jdbcURL) poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = ?", ResultMap, 3); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = ?", ResultMap, 3); string errorMessage = ""; if (dt is table) { while (dt.hasNext()) { @@ -343,8 +343,8 @@ function testAssignNullArrayToNonNillableTypeWithNillableElements(string jdbcURL poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = ?", ResultMapNonNillableTypeNillableElements, 3); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = ?", ResultMapNonNillableTypeNillableElements, 3); string errorMessage = ""; if (dt is table) { while (dt.hasNext()) { @@ -366,8 +366,8 @@ function testAssignNullElementArrayToNonNillableTypeWithNonNillableElements(stri poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = ?", ResultMap, 2); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = ?", ResultMap, 2); string errorMessage = ""; if (dt is table) { while (dt.hasNext()) { @@ -389,8 +389,8 @@ function testAssignNullElementArrayToNillableTypeWithNonNillableElements(string poolOptions: {maximumPoolSize: 1} }); - var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array, - string_array from ArrayTypes where row_id = ?", ResultMapNillableTypeNonNillableElements, 2); + var dt = testDB->select("SELECT int_array, long_array, float_array, boolean_array," + + "string_array from ArrayTypes where row_id = ?", ResultMapNillableTypeNonNillableElements, 2); string errorMessage = ""; if (dt is table) { while (dt.hasNext()) { diff --git a/stdlib/jdbc/src/test/resources/test-src/transaction/local_transaction_test.bal b/stdlib/jdbc/src/test/resources/test-src/transaction/local_transaction_test.bal index 98991e5b62bc..d3802ba59ac9 100644 --- a/stdlib/jdbc/src/test/resources/test-src/transaction/local_transaction_test.bal +++ b/stdlib/jdbc/src/test/resources/test-src/transaction/local_transaction_test.bal @@ -33,10 +33,10 @@ function testLocalTransaction(string jdbcURL) returns @tainted [int, int, boolea boolean committedBlockExecuted = false; boolean abortedBlockExecuted = false; transaction { - _ = checkpanic testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 200, 5000.75, 'USA')"); - _ = checkpanic testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 200, 5000.75, 'USA')"); + _ = checkpanic testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 200, 5000.75, 'USA')"); + _ = checkpanic testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 200, 5000.75, 'USA')"); } onretry { returnVal = -1; } committed { @@ -64,10 +64,10 @@ function testTransactionRollback(string jdbcURL) returns @tainted [int, int, boo boolean stmtAfterFailureExecuted = false; transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID, - creditLimit,country) values ('James', 'Clerk', 210, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers2 (firstName,lastName,registrationID, - creditLimit,country) values ('James', 'Clerk', 210, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID," + + "creditLimit,country) values ('James', 'Clerk', 210, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers2 (firstName,lastName,registrationID," + + "creditLimit,country) values ('James', 'Clerk', 210, 5000.75, 'USA')"); stmtAfterFailureExecuted = true; } onretry { @@ -91,10 +91,10 @@ function testLocalTransactionUpdateWithGeneratedKeys(string jdbcURL) returns @ta int returnVal = 0; int count; transaction { - var e1 = testDB->update("Insert into Customers - (firstName,lastName,registrationID,creditLimit,country) values ('James', 'Clerk', 615, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers - (firstName,lastName,registrationID,creditLimit,country) values ('James', 'Clerk', 615, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers " + + "(firstName,lastName,registrationID,creditLimit,country) values ('James', 'Clerk', 615, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers " + + "(firstName,lastName,registrationID,creditLimit,country) values ('James', 'Clerk', 615, 5000.75, 'USA')"); } onretry { returnVal = -1; } @@ -117,10 +117,10 @@ function testTransactionRollbackUpdateWithGeneratedKeys(string jdbcURL) returns int count; transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID, - creditLimit,country) values ('James', 'Clerk', 618, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers2 (firstName,lastName,registrationID, - creditLimit,country) values ('James', 'Clerk', 618, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID," + + "creditLimit,country) values ('James', 'Clerk', 618, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers2 (firstName,lastName,registrationID," + + "creditLimit,country) values ('James', 'Clerk', 618, 5000.75, 'USA')"); } onretry { returnVal = -1; } @@ -218,10 +218,10 @@ function testLocalTransactionBatchUpdate(string jdbcURL) returns @tainted [int, jdbc:Parameter?[] parameters2 = [para1, para2, para3, para4, para5]; transaction { - var e1 = testDB->batchUpdate("Insert into Customers - (firstName,lastName,registrationID,creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); - var e2 = testDB->batchUpdate("Insert into Customers - (firstName,lastName,registrationID,creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); + var e1 = testDB->batchUpdate("Insert into Customers " + + "(firstName,lastName,registrationID,creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); + var e2 = testDB->batchUpdate("Insert into Customers " + + "(firstName,lastName,registrationID,creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); } onretry { returnVal = -1; } @@ -260,10 +260,10 @@ function testLocalTransactionRollbackBatchUpdate(string jdbcURL) returns @tainte jdbc:Parameter?[] parameters2 = [para1, para2, para3, para4, para5]; transaction { - var e1 = testDB->batchUpdate("Insert into Customers - (firstName,lastName,registrationID,creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); - var e2 = testDB->batchUpdate("Insert into Customers2 - (firstName,lastName,registrationID,creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); + var e1 = testDB->batchUpdate("Insert into Customers " + + "(firstName,lastName,registrationID,creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); + var e2 = testDB->batchUpdate("Insert into Customers2 " + + "(firstName,lastName,registrationID,creditLimit,country) values (?,?,?,?,?)", false, parameters1, parameters2); } onretry { returnVal = -1; } @@ -285,11 +285,11 @@ function testTransactionAbort(string jdbcURL) returns @tainted [int, int] { int returnVal = -1; int count; transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 220, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 220, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 220, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 220, 5000.75, 'USA')"); int i = 0; if (i == 0) { abort; @@ -331,8 +331,8 @@ function testTransactionErrorPanic(string jdbcURL) returns @tainted [int, int, i function testTransactionErrorPanicHelper(jdbc:Client testDB) { int returnVal = 0; transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName, - registrationID,creditLimit,country) values ('James', 'Clerk', 260, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName," + + "registrationID,creditLimit,country) values ('James', 'Clerk', 260, 5000.75, 'USA')"); int i = 0; if (i == 0) { error e = error("error"); @@ -355,8 +355,8 @@ function testTransactionErrorPanicAndTrap(string jdbcURL) returns @tainted [int, int catchValue = 0; int count; transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID, - creditLimit,country) values ('James', 'Clerk', 250, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID," + + "creditLimit,country) values ('James', 'Clerk', 250, 5000.75, 'USA')"); var ret = trap testTransactionErrorPanicAndTrapHelper(0); if (ret is error) { catchValue = -1; @@ -389,10 +389,10 @@ function testTransactionCommitted(string jdbcURL) returns @tainted [int, int] { int returnVal = 1; int count; transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit, - country) values ('James', 'Clerk', 300, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit, - country) values ('James', 'Clerk', 300, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit," + + "country) values ('James', 'Clerk', 300, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit," + + "country) values ('James', 'Clerk', 300, 5000.75, 'USA')"); } onretry { returnVal = -1; } @@ -415,19 +415,19 @@ function testTwoTransactions(string jdbcURL) returns @tainted [int, int, int] { int returnVal2 = 1; int count; transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 400, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 400, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 400, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 400, 5000.75, 'USA')"); } onretry { returnVal1 = 0; } transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 400, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 400, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 400, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 400, 5000.75, 'USA')"); } onretry { returnVal2 = 0; } @@ -447,10 +447,10 @@ function testTransactionWithoutHandlers(string jdbcURL) returns @tainted int { }); transaction { - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) values - ('James', 'Clerk', 350, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) values - ('James', 'Clerk', 350, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) values " + + "('James', 'Clerk', 350, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) values " + + "('James', 'Clerk', 350, 5000.75, 'USA')"); } int count; @@ -489,10 +489,10 @@ function testLocalTransactionFailedHelper(string status, jdbc:Client testDB) ret string a = status; transaction with retries = 4 { a = a + " inTrx"; - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 111, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers2 (firstName,lastName,registrationID,creditLimit,country) - values ('Anne', 'Clerk', 111, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 111, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers2 (firstName,lastName,registrationID,creditLimit,country) " + + "values ('Anne', 'Clerk', 111, 5000.75, 'USA')"); } onretry { a = a + " onRetry"; } aborted { @@ -528,14 +528,14 @@ function testLocalTransactionSuccessWithFailedHelper(string status, jdbc:Client string a = status; transaction with retries = 4 { a = a + " inTrx"; - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 222, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country)" + + " values ('James', 'Clerk', 222, 5000.75, 'USA')"); if (i == 2) { - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('Anne', 'Clerk', 222, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('Anne', 'Clerk', 222, 5000.75, 'USA')"); } else { - var e3 = testDB->update("Insert into Customers2 (firstName,lastName,registrationID,creditLimit,country) - values ('Anne', 'Clerk', 222, 5000.75, 'USA')"); + var e3 = testDB->update("Insert into Customers2 (firstName,lastName,registrationID,creditLimit,country) " + + "values ('Anne', 'Clerk', 222, 5000.75, 'USA')"); } } onretry { a = a + " onRetry"; @@ -568,8 +568,8 @@ function testLocalTransactionFailedWithNextupdate(string jdbcURL) returns @taint if (ret is error) { i = -1; } - var e = checkpanic testDB1->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 12343, 5000.75, 'USA')"); + var e = checkpanic testDB1->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 12343, 5000.75, 'USA')"); checkpanic testDB1.stop(); var dt = testDB2->select("Select COUNT(*) as countval from Customers where registrationID = 12343", @@ -581,8 +581,8 @@ function testLocalTransactionFailedWithNextupdate(string jdbcURL) returns @taint function testLocalTransactionFailedWithNextupdateHelper(jdbc:Client testDB) { transaction { - var e = testDB->update("Insert into Customers (firstNamess,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 1234, 5000.75, 'USA')"); + var e = testDB->update("Insert into Customers (firstNamess,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 1234, 5000.75, 'USA')"); } } @@ -597,8 +597,8 @@ function testNestedTwoLevelTransactionSuccess(string jdbcURL) returns @tainted [ int returnVal = 0; int count; transaction { - var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 333, 5000.75, 'USA')"); + var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 333, 5000.75, 'USA')"); testNestedTwoLevelTransactionSuccessParticipant(testDB); } onretry { returnVal = -1; @@ -612,8 +612,8 @@ function testNestedTwoLevelTransactionSuccess(string jdbcURL) returns @tainted [ @transactions:Participant {} function testNestedTwoLevelTransactionSuccessParticipant(jdbc:Client testDB) { - var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 333, 5000.75, 'USA')"); + var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 333, 5000.75, 'USA')"); } function testNestedThreeLevelTransactionSuccess(string jdbcURL) returns @tainted [int, int] { @@ -627,8 +627,8 @@ function testNestedThreeLevelTransactionSuccess(string jdbcURL) returns @tainted int returnVal = 0; int count; transaction { - var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 444, 5000.75, 'USA')"); + var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 444, 5000.75, 'USA')"); testNestedThreeLevelTransactionSuccessParticipant1(testDB); } onretry { returnVal = -1; @@ -642,15 +642,15 @@ function testNestedThreeLevelTransactionSuccess(string jdbcURL) returns @tainted @transactions:Participant {} function testNestedThreeLevelTransactionSuccessParticipant1(jdbc:Client testDB) { - var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 444, 5000.75, 'USA')"); + var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 444, 5000.75, 'USA')"); testNestedThreeLevelTransactionSuccessParticipant2(testDB); } @transactions:Participant {} function testNestedThreeLevelTransactionSuccessParticipant2(jdbc:Client testDB) { - _ = checkpanic testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 444, 5000.75, 'USA')"); + _ = checkpanic testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 444, 5000.75, 'USA')"); } function testNestedThreeLevelTransactionFailed(string jdbcURL) returns @tainted [int, int] { @@ -677,8 +677,8 @@ function testNestedThreeLevelTransactionFailed(string jdbcURL) returns @tainted function testNestedThreeLevelTransactionFailedHelper(jdbc:Client testDB) returns int { int returnVal = 0; transaction { - _ = checkpanic testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 555, 5000.75, 'USA')"); + _ = checkpanic testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 555, 5000.75, 'USA')"); testNestedThreeLevelTransactionFailedHelperParticipant1(testDB); } onretry { returnVal = -1; @@ -688,22 +688,22 @@ function testNestedThreeLevelTransactionFailedHelper(jdbc:Client testDB) returns @transactions:Participant {} function testNestedThreeLevelTransactionFailedHelperParticipant1(jdbc:Client testDB) { - var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 555, 5000.75, 'USA')"); + var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 555, 5000.75, 'USA')"); testNestedThreeLevelTransactionFailedHelperParticipant2(testDB); } @transactions:Participant {} function testNestedThreeLevelTransactionFailedHelperParticipant2(jdbc:Client testDB) { - var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 555, 5000.75, 'USA')"); + var e = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 555, 5000.75, 'USA')"); testNestedThreeLevelTransactionFailedHelperParticipant3(testDB); } @transactions:Participant {} function testNestedThreeLevelTransactionFailedHelperParticipant3(jdbc:Client testDB) { - var e = testDB->update("Insert into Customers (invalidColumn,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 555, 5000.75, 'USA')"); + var e = testDB->update("Insert into Customers (invalidColumn,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 555, 5000.75, 'USA')"); } function testLocalTransactionWithSelectAndForeachIteration(string jdbcURL) returns @tainted [int, int] { @@ -714,23 +714,21 @@ function testLocalTransactionWithSelectAndForeachIteration(string jdbcURL) retur poolOptions: {maximumPoolSize: 5} }); - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 900, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 900, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 900, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 900, 5000.75, 'USA')"); int returnVal = 0; int count = -1; transaction { - var dt1 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 900", ResultCount); + var dt1 = testDB->select("Select COUNT(*) as countval from Customers where registrationID = 900", ResultCount); if (dt1 is table) { foreach var row in dt1 { count = row.COUNTVAL; } } - var dt2 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 900", ResultCount); + var dt2 = testDB->select("Select COUNT(*) as countval from Customers where registrationID = 900", ResultCount); if (dt2 is table) { foreach var row in dt2 { count = row.COUNTVAL; @@ -751,25 +749,24 @@ function testLocalTransactionWithUpdateAfterSelectAndForeachIteration(string jdb poolOptions: {maximumPoolSize: 5} }); - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 902, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 902, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 902, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 902, 5000.75, 'USA')"); int returnVal = 0; int count = -1; transaction { - var dt1 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 902", ResultCount); + var dt1 = testDB->select("Select COUNT(*) as countval from Customers where registrationID = 902", ResultCount); if (dt1 is table) { foreach var row in dt1 { count = row.COUNTVAL; } } - var e3 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 902, 5000.75, 'USA')"); - var dt2 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 902", ResultCount); + var e3 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 902, 5000.75, 'USA')"); + var dt2 = testDB->select("Select COUNT(*) as countval from Customers where " + + "registrationID = 902", ResultCount); if (dt2 is table) { foreach var row in dt2 { count = row.COUNTVAL; @@ -790,16 +787,16 @@ function testLocalTransactionWithUpdateAfterSelectAndBreakingWhileIteration(stri poolOptions: {maximumPoolSize: 5} }); - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 903, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 903, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 903, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 903, 5000.75, 'USA')"); int returnVal = 0; int count = -1; transaction { - var dt1 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 903", ResultCount); + var dt1 = testDB->select("Select COUNT(*) as countval from Customers where " + + "registrationID = 903", ResultCount); if (dt1 is table) { while (dt1.hasNext()) { var rs = dt1.getNext(); @@ -809,10 +806,10 @@ function testLocalTransactionWithUpdateAfterSelectAndBreakingWhileIteration(stri break; } } - var e3 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 903, 5000.75, 'USA')"); - var dt2 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 903", ResultCount); + var e3 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 903, 5000.75, 'USA')"); + var dt2 = testDB->select("Select COUNT(*) as countval from Customers where " + + "registrationID = 903", ResultCount); if (dt2 is table) { foreach var row in dt2 { count = row.COUNTVAL; @@ -833,24 +830,24 @@ function testLocalTransactionWithUpdateAfterSelectAndTableClosure(string jdbcURL poolOptions: {maximumPoolSize: 5} }); - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 904, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 904, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 904, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 904, 5000.75, 'USA')"); int returnVal = 0; int count = -1; transaction { - var dt1 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 904", ResultCount); + var dt1 = testDB->select("Select COUNT(*) as countval from Customers where " + + "registrationID = 904", ResultCount); if (dt1 is table) { dt1.close(); } - var e3 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 904, 5000.75, 'USA')"); - var dt2 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 904", ResultCount); + var e3 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 904, 5000.75, 'USA')"); + var dt2 = testDB->select("Select COUNT(*) as countval from Customers where " + + "registrationID = 904", ResultCount); if (dt2 is table) { foreach var row in dt2 { count = row.COUNTVAL; @@ -871,19 +868,19 @@ function testLocalTransactionWithSelectAndHasNextIteration(string jdbcURL) retur poolOptions: {maximumPoolSize: 5} }); - var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 901, 5000.75, 'USA')"); - var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('James', 'Clerk', 901, 5000.75, 'USA')"); + var e1 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 901, 5000.75, 'USA')"); + var e2 = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('James', 'Clerk', 901, 5000.75, 'USA')"); int returnVal = 0; int count = -1; transaction { - var dt1 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 901", ResultCount); + var dt1 = testDB->select("Select COUNT(*) as countval from Customers where " + + "registrationID = 901", ResultCount); count = getTableCountValColumn(dt1); - var dt2 = testDB->select("Select COUNT(*) as countval from Customers where - registrationID = 901", ResultCount); + var dt2 = testDB->select("Select COUNT(*) as countval from Customers where " + + "registrationID = 901", ResultCount); count = getTableCountValColumn(dt2); } onretry { returnVal = -1; diff --git a/stdlib/jdbc/src/test/resources/test-src/transaction/xa_transaction_test.bal b/stdlib/jdbc/src/test/resources/test-src/transaction/xa_transaction_test.bal index 8cb26283ce3f..188fbeee90ad 100644 --- a/stdlib/jdbc/src/test/resources/test-src/transaction/xa_transaction_test.bal +++ b/stdlib/jdbc/src/test/resources/test-src/transaction/xa_transaction_test.bal @@ -35,8 +35,8 @@ function testXATransactionSuccess(string jdbcURL1, string jdbcURL2) returns @tai }); transaction { - _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) - values (1, 'Anne', 1000, 'UK')"); + _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) " + + "values (1, 'Anne', 1000, 'UK')"); _ = checkpanic testDB2->update("insert into Salary (id, value ) values (1, 1000)"); } @@ -70,8 +70,8 @@ function testXATransactionSuccessWithDataSource(string jdbcURL1, string jdbcURL2 }); transaction { - _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) - values (10, 'Anne', 1000, 'UK')"); + _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) " + + "values (10, 'Anne', 1000, 'UK')"); _ = checkpanic testDB2->update("insert into Salary (id, value ) values (10, 1000)"); } @@ -104,8 +104,8 @@ function testXATransactionSuccessWithH2Client(string jdbcURL1, string jdbcURL2) }); transaction { - _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) - values (11, 'Anne', 1000, 'UK')"); + _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) " + + "values (11, 'Anne', 1000, 'UK')"); _ = checkpanic testDB2->update("insert into Salary (id, value ) values (11, 1000)"); } @@ -156,8 +156,8 @@ function testXATransactionFailed1(string jdbcURL1, string jdbcURL2) returns @tai function testXATransactionFailed1Helper(jdbc:Client testDB1, jdbc:Client testDB2) { transaction { - _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) - values (2, 'John', 1000, 'UK')"); + _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) " + + "values (2, 'John', 1000, 'UK')"); _ = checkpanic testDB2->update("insert into Salary (id, invalidColumn ) values (2, 1000)"); } } @@ -192,8 +192,8 @@ function testXATransactionFailed2(string jdbcURL1, string jdbcURL2) returns @tai function testXATransactionFailed2Helper(jdbc:Client testDB1, jdbc:Client testDB2) { transaction { - _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, invalidColumn) - values (2, 'John', 1000, 'UK')"); + _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, invalidColumn) " + + "values (2, 'John', 1000, 'UK')"); _ = checkpanic testDB2->update("insert into Salary (id, value ) values (2, 1000)"); } } @@ -231,11 +231,11 @@ function testXATransactionRetryHelper(jdbc:Client testDB1, jdbc:Client testDB2) int i = 0; transaction { if (i == 2) { - _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) - values (4, 'John', 1000, 'UK')"); + _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, country) " + + "values (4, 'John', 1000, 'UK')"); } else { - _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, invalidColumn) - values (4, 'John', 1000, 'UK')"); + _ = checkpanic testDB1->update("insert into Customers (customerId, name, creditLimit, invalidColumn) " + + "values (4, 'John', 1000, 'UK')"); } _ = checkpanic testDB2->update("insert into Salary (id, value ) values (4, 1000)"); } onretry { diff --git a/stdlib/streams/src/main/ballerina/src/streams/processor/order-by-processor.bal b/stdlib/streams/src/main/ballerina/src/streams/processor/order-by-processor.bal index f805c9ce6420..f8515997ce10 100644 --- a/stdlib/streams/src/main/ballerina/src/streams/processor/order-by-processor.bal +++ b/stdlib/streams/src/main/ballerina/src/streams/processor/order-by-processor.bal @@ -203,8 +203,8 @@ public type MergeSort object { panic err; } } else { - error err = error("Values of types other than strings and numbers cannot be sorted in fieldIndex: - " + fieldIndex.toString() + ", sortType: " + self.sortTypes[fieldIndex]); + error err = error("Values of types other than strings and numbers cannot be sorted in fieldIndex:" + + fieldIndex.toString() + ", sortType: " + self.sortTypes[fieldIndex]); panic err; } } else { diff --git a/stdlib/streams/src/main/ballerina/src/streams/window/unique-length-window.bal b/stdlib/streams/src/main/ballerina/src/streams/window/unique-length-window.bal index bc5240ed8719..7015ee68d39b 100644 --- a/stdlib/streams/src/main/ballerina/src/streams/window/unique-length-window.bal +++ b/stdlib/streams/src/main/ballerina/src/streams/window/unique-length-window.bal @@ -70,8 +70,7 @@ public type UniqueLengthWindow object { if(parameter1 is int) { self.length = parameter1; } else { - error err = error("UniqueLength window's second parameter, windowLength should be of type - int"); + error err = error("UniqueLength window's second parameter, windowLength should be of type int"); panic err; } } else { diff --git a/tests/jballerina-integration-test/src/test/resources/transaction/src/transactionservices/03_participant2.bal b/tests/jballerina-integration-test/src/test/resources/transaction/src/transactionservices/03_participant2.bal index 2ce824f8521f..e4cb231521d0 100644 --- a/tests/jballerina-integration-test/src/test/resources/transaction/src/transactionservices/03_participant2.bal +++ b/tests/jballerina-integration-test/src/test/resources/transaction/src/transactionservices/03_participant2.bal @@ -157,8 +157,8 @@ function saveToDatabase(http:Caller conn, http:Request req, boolean shouldAbort) function saveToDatabaseUpdateHelper1(string uuid) { io:println("inserting uuid: " + uuid); - var result = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) - values ('John', 'Doe', '" + uuid + "', 5000.75, 'USA')"); + var result = testDB->update("Insert into Customers (firstName,lastName,registrationID,creditLimit,country) " + + "values ('John', 'Doe', '" + uuid + "', 5000.75, 'USA')"); if (result is jdbc:UpdateResult) { io:println(result); } else { diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/types/string/StringTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/types/string/StringTest.java index 4d64c7cc5d5f..ddcaab664952 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/types/string/StringTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/types/string/StringTest.java @@ -37,6 +37,8 @@ import java.nio.charset.StandardCharsets; +import static org.ballerinalang.test.util.BAssertUtil.validateError; + /** * Test Native functions in ballerina.model.string. */ @@ -174,4 +176,35 @@ public void testToByteArray() { Assert.assertEquals(bByteArray.size(), bytes.length); ByteArrayUtils.assertJBytesWithBBytes(bytes, bByteArray.getBytes()); } + + @Test + public void testMultilineStringLiterals() { + CompileResult multilineLiterals = BCompileUtil.compile("test-src/types/string/string_negative.bal"); + int indx = 0; + + validateError(multilineLiterals, indx++, "token recognition error at: '\"Hello\\n'", 17, 23); + validateError(multilineLiterals, indx++, + "mismatched input '!'. expecting {'is', ';', '.', '[', '?', '?.', '+', '-', '*', '/', '%', " + + "'==', '!=', '>', '<', '>=', '<=', '&&', '||', '===', '!==', '&', '^', '@', '...', '|'," + + " '?:', '->>', '..<', '.@'}", 18, 6); + validateError(multilineLiterals, indx++, "token recognition error at: '\";\\n'", 18, 7); + validateError(multilineLiterals, indx++, "token recognition error at: '\"Hello\\n'", 21, 17); + validateError(multilineLiterals, indx++, + "mismatched input '!'. expecting {'is', ';', '.', '[', '?', '?.', '+', '-', '*', '/', '%', " + + "'==', '!=', '>', '<', '>=', '<=', '&&', '||', '===', '!==', '&', '^', '@', '...', '|'," + + " '?:', '->>', '..<', '.@'}", 22, 10); + validateError(multilineLiterals, indx++, "token recognition error at: '\";\\n'", 22, 11); + validateError(multilineLiterals, indx++, "token recognition error at: '\"Another Hello\\n'", 24, 17); + validateError(multilineLiterals, indx++, + "mismatched input 'with'. expecting {'is', ';', '.', '[', '?', '?.', '+', '-', '*', '/', '%', " + + "'==', '!=', '>', '<', '>=', '<=', '&&', '||', '===', '!==', '&', '^', '@', '...', '|'," + + " '?:', '->>', '..<', '.@'}", 25, 19); + validateError(multilineLiterals, indx++, "token recognition error at: '\";\\n'", 25, 39); + validateError(multilineLiterals, indx++, "mismatched input 's3'. expecting {'(', '[', '?', '|'}", 27, 12); + validateError(multilineLiterals, indx++, "token recognition error at: '\"Multiple\\n'", 27, 17); + validateError(multilineLiterals, indx++, "mismatched input 'Hello'. expecting {',', ')'}", 29, 5); + validateError(multilineLiterals, indx++, "token recognition error at: '\";\\n'", 30, 11); + + Assert.assertEquals(multilineLiterals.getErrorCount(), indx); + } } diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/types/string/string_negative.bal b/tests/jballerina-unit-test/src/test/resources/test-src/types/string/string_negative.bal new file mode 100644 index 000000000000..3f9be79d9d78 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/types/string/string_negative.bal @@ -0,0 +1,31 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +string glbMultiLine = "Hello +World!"; + +function testMultilineStrings() { + string s1 = "Hello + World!"; + + string s2 = "Another Hello + World with new line + tabs"; + + string s3 = "Multiple + Line + Hello + World!"; +}