提交 f8c90521 编写于 作者: F freemine

scanner pattern

上级 e6fba264
...@@ -94,13 +94,15 @@ do { \ ...@@ -94,13 +94,15 @@ do { \
<KEY>.|\n { return -1; } <KEY>.|\n { return -1; }
<EQ>[[:space:]]+ { } <EQ>[[:space:]]+ { }
<EQ>[^][{}(),;?*=!@/\\\n]+ { set_val(); CHG_STATE(VAL); } <EQ>[^][{}(),;?*=!@/\\\n[:space:]]+ { set_val(); CHG_STATE(VAL); }
<EQ>[{] { CHG_STATE(BRACE1); } <EQ>[{] { CHG_STATE(BRACE1); }
<EQ>.|\n { return -1; } <EQ>.|\n { return -1; }
<BRACE1>[^{}\n]+ { set_val(); CHG_STATE(BRACE2); } <BRACE1>[[:space:]]+ { }
<BRACE1>[^{}\n[:space:]]+ { set_val(); CHG_STATE(BRACE2); }
<BRACE1>.|\n { return -1; } <BRACE1>.|\n { return -1; }
<BRACE2>[[:space:]]+ { }
<BRACE2>[}] { CHG_STATE(VAL); } <BRACE2>[}] { CHG_STATE(VAL); }
<BRACE2>.|\n { return -1; } <BRACE2>.|\n { return -1; }
...@@ -112,7 +114,7 @@ int todbc_parse_conn_string(const char *conn, char **dsn, char **uid, char **pwd ...@@ -112,7 +114,7 @@ int todbc_parse_conn_string(const char *conn, char **dsn, char **uid, char **pwd
yyscan_t arg = {0}; yyscan_t arg = {0};
params_t params = {0}; params_t params = {0};
yylex_init(&arg); yylex_init(&arg);
yyset_debug(1, arg); yyset_debug(0, arg);
yyset_extra(&params, arg); yyset_extra(&params, arg);
yy_scan_string(conn, arg); yy_scan_string(conn, arg);
int ret =yylex(arg); int ret =yylex(arg);
......
import pyodbc import pyodbc
cnxn = pyodbc.connect('DSN=TAOS_DSN;UID=root;PWD=taosdata;HOST=localhost:6030', autocommit=True) # cnxn = pyodbc.connect('DSN={TAOS_DSN};UID={ root };PWD={ taosdata };HOST={ localhost:6030 }', autocommit=True)
cnxn = pyodbc.connect('DSN={TAOS_DSN}; UID=root;PWD=taosdata; HOST=localhost:6030', autocommit=True)
cnxn.setdecoding(pyodbc.SQL_CHAR, encoding='utf-8') cnxn.setdecoding(pyodbc.SQL_CHAR, encoding='utf-8')
#cnxn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf-8') #cnxn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf-8')
#cnxn.setencoding(encoding='utf-8') #cnxn.setencoding(encoding='utf-8')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册