From 461d2891b97137fa4e0981f278a7ecbe04e6a8ed Mon Sep 17 00:00:00 2001 From: fumingwei Date: Tue, 13 Jun 2023 18:13:00 +0800 Subject: feature:提供对table row所用值操作的接口,提高dynamic metric写的性能 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fieldstat.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/fieldstat.cpp') diff --git a/src/fieldstat.cpp b/src/fieldstat.cpp index 2126d82..df773dd 100644 --- a/src/fieldstat.cpp +++ b/src/fieldstat.cpp @@ -116,6 +116,29 @@ void escaping_special_chars(char* str) } +int escaping_special_chars_cpoy(char *dest, char *src, size_t n) +{ + size_t i; + int len = 0; + + for(i = 0; i < n - 1 && src[i] != '\0'; i++) + { + if (src[i] == '.') + { + dest[i] = '_'; + } + else + { + dest[i] = src[i]; + } + len ++; + } + for ( ; i < n; i++) + { + dest[i] = '\0'; + } + return len; +} void get_current_table_line_cnt(struct fieldstat_instance *instance, int n_table, int *tables_line_cnt) { -- cgit v1.2.3