Error reported when the cli_autoincrement auto-Increment Variable is defined in Fastdb, fastdbcli

Source: Internet
Author: User
Tags unsupported

Error reported when the cli_autoincrement auto-Increment Variable is defined in Fastdb, fastdbcli

I recently tried to use fastdb for development. The test in c ++ version is basically OK. Because the project team adopts C # development, I switched to C # To develop fastdb. The results showed that C # versions were castrated, if the custom variable is auto-incrementing, an error occurs in the type definition. After some tracing, it is found that cli_autoincrement is not defined when the fastdb value is set.

Fastdb processes cli_autoincrement in a way similar to int4, so it performs type conversion similar to int4.

The modification code is 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 has too few documents and the Community is inactive. You are welcome to make a positive contribution.

The query speed of fastdb is at the forefront of similar databases.

The C # version of fastdb is the encapsulation of the C ++ version and is not completed. Please use it with caution for commercial development.

 


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

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.