TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

Error of unable to connect the TDengine

Open tangbao0002 opened this issue 3 years ago • 4 comments

In my project, when I use upper case database name to connect the database by the library TDengine Connector 3.0.1 , the function 'TDengine.Connect' will return IntPtr.Zero. But when use lowercase database name, it will get a success result.

tangbao0002 avatar Nov 21 '22 07:11 tangbao0002

Firstly, thank you for your issue. For the following interface, the parameter "db" will send to taosc (taos client without any change). static extern public IntPtr Connect(string ip, string user, string password, string db, short port);

You got two kinds of responses, since TDengine's database name is case sensitive. For example, database test and database TEST, they are different databases.

Besides, IntPtr.Zero same as null pointer which means you got null pointer while connecting to you database. Since can connect to TDengine with parameters you just passed.

xleili avatar Nov 21 '22 07:11 xleili

image But when I use TDengine Client, TDengine's database name is not case sensitive.

tangbao0002 avatar Nov 21 '22 08:11 tangbao0002

image But when I use TDengine Client, TDengine's database name is not case sensitive.

Yes, connect and query behavior is different by design

sangshuduo avatar Nov 22 '22 00:11 sangshuduo

The basic rule is that in a SQL statement using `` means your SQL statement is case sensitive, on the hand statement without `` means you SQL statement is case insensitive.

  1. For the SQL statements being executed in taos-shell, that follows this rule
  2. For the SQL statements being executed with Interface TDengine.Query() also follow this rule.
  3. For the C# connector interface TDengine.Connect(), the parameter db is case sensitive. You don't have to send database name with ``, which means "test"="test" or "TEST"="TEST"

xleili avatar Nov 22 '22 07:11 xleili

any problem we still have ?

yu285 avatar Nov 28 '22 14:11 yu285