更新日期:2024年09月11日
stcmpr() 函数比较两个以空终止的字符串。
语法
mint stcmpr(s1, s2)
char *s1, *s2;
s1
指向第一个以空终止的字符串的指针。
s2
指向第二个以空终止的字符串的指针。
重要: 在 ASCII 排序序列中,当 s1 出现在 s2 之后时,s1 大于 s2。
返回代码
=0
两个字符串相同。
<0
第一个字符串小于第二个字符串。
>0
第一个字符串大于第二个字符串。
示例
GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 955 -
此样例程序在 demo 目录中的 stcmpr.ec 文件中。
/*
* stcmpr.ec *
The following program displays the results of three string comparisons using stcmpr().
*/
#include
main()
{
printf("STCMPR Sample ESQL Program running.\n\n");
printf("Executing: stcmpr(\"aaa\", \"aaa\")\n");
printf(" Result = %d", stcmpr("aaa", "aaa")); /* equal */
printf("\nExecuting: stcmpr(\"aaa\", \"aaaa\")\n");
printf(" Result = %d", stcmpr("aaa", "aaaa")); /* less */
printf("\nExecuting: stcmpr(\"bbb\", \"aaaa\")\n");
printf(" Result = %d\n", stcmpr("bbb", "aaaa")); /* greater */
printf("\nSTCMPR Sample Program over.\n\n");
}
输出
STCMPR Sample ESQL Program running.
Executing: stcmpr("aaa", "aaa")
Result = 0
Executing: stcmpr("aaa", "aaaa")
Result = -1
Executing: stcmpr("bbb", "aaaa")
Result = 1
STCMPR Sample Program over.
GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 956 -
定义库自定义字符集引起集群扩容数据重分布
失败
问题现象
集群字符集为utf8,但部分库建库使用gbk,gbk 库下建表又使用utf8,扩容的节
点生成的库却为utf8,重分布时报源表与目标表不一致后错误
express 日志
[ERROR][S:52707840][Q:2263201877]:Query failed, THD(0x297a42000)
HOST(172.31.105.4:5050->102939605) reason: (GBA-01EX-700) Gbase general
error: (gns_host: 172.31.105.18) source table and destination table are not same:
src:( localhost:szhsjpt.8a_rebalancing_57757954_n10 )
dst:( 172.31.105.3:szhsjpt.8a_rebalancing_57757954_n10 ) column type: [0]type: 1,
precision: 2304, scale: 0, is_lookup: 0, nulls_mode: 2, internal_size: 2304,
display_size: 768 -- type: 1, precision: 1536, scale: 0, is_lookup: 0, nulls_mode: 2,
GBase 8a MPP Cluster 最佳实践
5 FAQ
文档版本(2022-02-11)
南大通用数据技术股份有限公司
158
internal_size: 1536, display_size: 768 SQL(SELECT * FROM `szhsjpt`.`a_refund_n6`
LIMIT 0,92910 TARGET INTO SERVER(HOST
'172.31.105.9,172.31.105.10,172.31.105.11,172.31.105.12,172.31.105.13,172.31.105.
14,172.31.105.15,172.31.105.16,172.31.105.17,172.31.105.18,172.31.105.3,172.31.10