Fastdb definition cli_autoincrement self-increment variable error

Source: Internet
Author: User
Tags unsupported

recently trying to use Fastdb for development, C + + version under test basic OK , since the project team adopted C # development, so the switch C # Development Fastdb , the results found C # version of a variety of castration, if the definition of variable self-increment, then a type definition error occurs, a trace down found in Fastdb not defined when value is taken cli_autoincrement caused by.

because Fastdb the cli_autoincrement is handled in a manner similar to Int4 , so it's a similar Int4 Type conversions for types

Modify the code as follows:

Protected unsafe virtual Object getValue (Type t) {
Switch (CLI. FieldType) ((CLI. unmanagedbuffer*) buffer. ToPointer ())->type) {
Case CLI. Fieldtype.cli_bool:
Case CLI. FieldType.cli_int1:return Convert.changetype (* (sbyte*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer (), t);
Case CLI. FieldType.cli_int2:return Convert.changetype (* (short*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer (), t);
Case CLI. FieldType.cli_oid:return Convert.changetype (* (uint*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer (), t);
Case CLI. FieldType.cli_autoincrement:return Convert.changetype (* (int*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer (), t);
Case CLI. FieldType.cli_int4:return Convert.changetype (* (int*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer (), t);
Case CLI. FieldType.cli_int8:return Convert.changetype (* (int64*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer (), t);
Case CLI. FieldType.cli_real4:return Convert.changetype (* (single*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer (), t);
Case CLI. Fieldtype.cli_datetime:
Case CLI. FieldType.cli_real8:return Convert.changetype (* (double*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer (), t);
Case CLI. Fieldtype.cli_asciiz:
Case CLI. FieldType.cli_pasciiz:return Convert.changetype (Marshal.ptrtostringansi ((CLI. unmanagedbuffer*) buffer. ToPointer ())->data), T);
Case CLI. Fieldtype.cli_array_of_int1:
if (t = = typeof (byte[])) {
int len = Size;
byte[] arr = new Byte[len];
byte* src = (byte*) (CLI. unmanagedbuffer*) buffer. ToPointer ())->data. ToPointer ();
for (int i = 0; i < len; i++) {
Arr[i] = *src++;
}
return arr;
} else {
throw new Clierror ("Getvalue:unsupported conversion type!" +enum.getname (typeof (CLI. FieldType), ((CLI. unmanagedbuffer*) buffer. ToPointer ()) (->type));
}
Default:throw new Clierror ("Getvalue:unsupported type!" +enum.getname (typeof (CLI. FieldType), ((CLI. unmanagedbuffer*) buffer. ToPointer ()) (->type));
}
}


run again, OK , run through

Personal feeling

Fastdb The literature is too small, the community is not active, welcome everyone to contribute actively.

Fastdb query speed is at the forefront of similar databases.

Fastdb of the C # version is C + + version of the package, but also belongs to the unfinished version, for commercial development please use caution.


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Fastdb definition cli_autoincrement self-increment variable error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.