feat: support 'select *, expr from ...' syntax

This commit is contained in:
Xiaoyu Wang 2022-06-30 17:52:34 +08:00
parent dc769a284f
commit 2ac9a78d58
1 changed files with 19 additions and 22 deletions

View File

@ -124,15 +124,13 @@ char* getCurrentTimeString(char* timeString) {
return timeString; return timeString;
} }
static void tmqStop(int signum, void *info, void *ctx) { static void tmqStop(int signum, void* info, void* ctx) {
running = 0; running = 0;
char tmpString[128]; char tmpString[128];
taosFprintfFile(g_fp, "%s tmqStop() receive stop signal[%d]\n", getCurrentTimeString(tmpString), signum); taosFprintfFile(g_fp, "%s tmqStop() receive stop signal[%d]\n", getCurrentTimeString(tmpString), signum);
} }
static void tmqSetSignalHandle() { static void tmqSetSignalHandle() { taosSetSignal(SIGINT, tmqStop); }
taosSetSignal(SIGINT, tmqStop);
}
void initLogFile() { void initLogFile() {
char filename[256]; char filename[256];
@ -433,7 +431,7 @@ static void dumpToFileForCheck(TdFilePtr pFile, TAOS_ROW row, TAOS_FIELD* fields
int32_t precision) { int32_t precision) {
for (int32_t i = 0; i < num_fields; i++) { for (int32_t i = 0; i < num_fields; i++) {
if (i > 0) { if (i > 0) {
taosFprintfFile(pFile, "\n"); taosFprintfFile(pFile, ",");
} }
shellDumpFieldToFile(pFile, (const char*)row[i], fields + i, length[i], precision); shellDumpFieldToFile(pFile, (const char*)row[i], fields + i, length[i], precision);
} }
@ -463,14 +461,14 @@ static int32_t msg_process(TAOS_RES* msg, SThreadInfo* pInfo, int32_t msgIndex)
int32_t precision = taos_result_precision(msg); int32_t precision = taos_result_precision(msg);
const char* tbName = tmq_get_table_name(msg); const char* tbName = tmq_get_table_name(msg);
#if 0 #if 0
// get schema // get schema
//============================== stub =================================================// //============================== stub =================================================//
for (int32_t i = 0; i < numOfFields; i++) { for (int32_t i = 0; i < numOfFields; i++) {
taosFprintfFile(g_fp, "%02d: name: %s, type: %d, len: %d\n", i, fields[i].name, fields[i].type, fields[i].bytes); taosFprintfFile(g_fp, "%02d: name: %s, type: %d, len: %d\n", i, fields[i].name, fields[i].type, fields[i].bytes);
} }
//============================== stub =================================================// //============================== stub =================================================//
#endif #endif
dumpToFileForCheck(pInfo->pConsumeRowsFile, row, fields, length, numOfFields, precision); dumpToFileForCheck(pInfo->pConsumeRowsFile, row, fields, length, numOfFields, precision);
@ -871,4 +869,3 @@ int main(int32_t argc, char* argv[]) {
return 0; return 0;
} }