Fairly basic question here. We are currently using 12.0.1.3942 (SQL Anywhere and Mobilink).

A colleague of mine recently wrote some code to limit our User Objects Id property. He set the valid characters to "^[a-zA-Z0-9]*$" and then stated that that's the only character set Mobilink supports so that's all we can support in our objects. Is this simply an instance of when he worked in Mobilink 8 that's all that was supported.

I can't find any evidence that Mobilink 12 has a special character set it doesn't support. Is there such a set and if so where can I find some documentation on it?

Thanks

asked 18 Dec '13, 10:01

Peacock's gravatar image

Peacock
1917817
accept rate: 100%


Short answer: SQL Anywhere 12 mluser.exe incorrectly rejects spaces in the MobiLink user name.

Long answer: "Hello, World!" is more-or-less silently ignored by SQL Anywhere 12.0.1.3298 mluser.exe; no "Inserted User:" confirmation is displayed and no row is written to the ml_user table, but no error message is displayed either:

"%SQLANY12%\bin64\mluser.exe"^
  -c "DSN=cons;UID=dba;PWD=sql"^
  -o "mluser_log.txt"^
  -u "Hello, World!"^
  -p 1234^
  -v

MobiLink Server User Utility Version 12.0.1.3298
This software is using security technology from Certicom Corp.
Shared administrative connection connected
ODBC DBMS Name: SQL Anywhere
ODBC DBMS Version: 12.00.0001
ODBC DBMS Driver Version: 12.00.0001
ODBC Version supported by the driver: 3.52
Collation sequence of the consolidated database is 'windows-1252'
ODBC DBMS Type: SQL Anywhere
ODBC isolation set to: Read Committed
Shared administrative connection disconnected

However, "Hello, World!" is definitely a valid MobiLink user name because it is accepted by CREATE statements and works when mlsrv12.exe -zu+ is used to bypass authentication:

CREATE SYNCHRONIZATION USER "Hello, World!" TYPE tcpip;

CREATE SYNCHRONIZATION SUBSCRIPTION TO p1 FOR "Hello, World!";

The proof lies in what dbmlsync.exe says during a successful synchronization:

"%SQLANY12%\bin64\mlsrv12.exe"^
  -c "DSN=cons;UID=dba;PWD=sql"^
  -o mlsrv12_log_cons.txt^
  -os 10M^
  -ppv 60^
  -vcefhkmnopstuU^
  -zu+

I. 2013-12-21 10:27:17. <1> (,Hello, World!) Synchronization complete

"%SQLANY12%\bin64\dbmlsync.exe"^
  -c "ENG=remo;DBN=remo;UID=REMOTE_DBA;PWD=SQL"^
  -e "adr='host=localhost';sv=v1"^
  -o dbmlsync_log_remo.txt^
  -os 10M^
  -vnosu^
  -x

I. 2013-12-21 10:27:16. MobiLink user name: Hello, World!

Experimentation indicates mluser.exe chokes on the space, since it accepts "1Hello,World!":

"%SQLANY12%\bin64\mluser.exe"^
  -c "DSN=cons;UID=dba;PWD=sql"^
  -o "mluser_log.txt"^
  -u "1Hello,World!"^
  -p 1234^
  -v

MobiLink Server User Utility Version 12.0.1.3298
This software is using security technology from Certicom Corp.
Shared administrative connection connected
ODBC DBMS Name: SQL Anywhere
ODBC DBMS Version: 12.00.0001
ODBC DBMS Driver Version: 12.00.0001
ODBC Version supported by the driver: 3.52
Collation sequence of the consolidated database is 'windows-1252'
ODBC DBMS Type: SQL Anywhere
ODBC isolation set to: Read Committed
Inserted User: 1Hello,World!
Shared administrative connection disconnected

and it works with authenticated synchronization (without mlsrv12.exe -zu+ and with dbmlsync.exe -mp 1234):

"%SQLANY12%\bin64\mlsrv12.exe"^
  -c "DSN=cons;UID=dba;PWD=sql"^
  -o mlsrv12_log_cons.txt^
  -os 10M^
  -ppv 60^
  -vcefhkmnopstuU

I. 2013-12-21 10:43:26. <1> (,1Hello,World!) Synchronization complete

"%SQLANY12%\bin64\dbmlsync.exe"^
  -c "ENG=remo;DBN=remo;UID=REMOTE_DBA;PWD=SQL"^
  -e "adr='host=localhost';sv=v1"^
  -mp 1234^
  -o dbmlsync_log_remo.txt^
  -os 10M^
  -vnosu^
  -x

I. 2013-12-21 10:43:26. MobiLink user name: 1Hello,World!
permanent link

answered 21 Dec '13, 10:42

Breck%20Carter's gravatar image

Breck Carter
25.7k427586845
accept rate: 20%

edited 21 Dec '13, 10:52

Are you referring to the names of actual database objects, like the names of tables, stored procedures, etc. (known as "Identifiers")? If so, then you should review the documentation on this subject for the limitations for how they can be formed.


Specifically for user data transferred within the MobiLink system (data stored in tables), we support whichever character set is being used by the remote database and the consolidated database. If they are different, there is an attempt to convert the data.

For more information on this process, see: Character set considerations and Character sets during synchronization.

permanent link

answered 18 Dec '13, 10:40

Jeff%20Albion's gravatar image

Jeff Albion
10.7k171174
accept rate: 24%

The question probably wasn't framed overly well but the gist of it is can I put a space in my mobilink user name?

mluser.exe -c "DSN=Database;" -u "User SpaceName" -p 1234 -v
MobiLink Server User Utility Version 11.0.1.2659
This software is using security technology from Certicom Corp.
ODBC DBMS Name: SQL Anywhere
ODBC DBMS Version: 12.00.0001
ODBC DBMS Driver Version: 12.00.3942
ODBC Version supported by the driver: 3.52
Collation sequence of the consolidated database is 'windows-1252'
ODBC isolation set to: Read Committed
Connected
Disconnected

You'll notice I'm trying to add a user with a space in the name. But mluser just connects and then disconnects.

(20 Dec '13, 13:44) Peacock
Replies hidden
1

can I put a space in my mobilink user name?

According to our SQL language rules, yes. MobiLink Usernames are also Identifiers - rules for Identifiers apply.

But mluser just connects and then disconnects.

Ah... that is a separate problem, which I can reproduce too. I can add the synchronization user with a space via Sybase Central and synchronize with the user in scripts okay, but can't add it via mluser.

I will see if this is a limitation to MobiLink usernames in general, or just an issue with the mluser utility.

(20 Dec '13, 14:27) Jeff Albion
1

After taking a look further at this issue, I have discovered that there is a slight complication to this behaviour - namely, even if the option were to be supported on the mluser command line via "-u", there would be no equivalent for "batch mode", using mluser -f, as the documentation states:

http://dcx.sybase.com/index.html#sa160/en/mlserver/dbmluser-ml-ref.html

"Reads the user names and passwords from the specified file. The file should be a text file containing one username and password pair on each line, separated by white space. You must specify either -f or -u."

This implies we would need another delimiter available inside of the batch file option also to fully support MobiLink user names with spaces in mluser.


I have opened CR #753787 to address the possibility of loosening this restriction, or allowing just "-u" to work for current versions. I will reply once we have decided on the correct behaviour, or if we intend to add a firmer restriction on the allowance of MobiLink user names with spaces.

For the time being, Breck is correct that "-zu+" and Sybase Central will add MobiLink usernames with spaces to the system successfully, and can be used in scripts successfully as I mentioned above, and Breck demonstrated in his answer.

However, If you use any "advanced" features of MobiLink (direct row handling, central administration of remotes, server-initiated synch, etc.) and really require spaces in your usernames, I would highly encourage thorough testing of all those features to ensure that the username is preserved correctly in those scenarios also - these features use different paths of code that we haven't considered here with our basic functionality testing.

(23 Dec '13, 12:45) Jeff Albion
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×290

question asked: 18 Dec '13, 10:01

question was seen: 1,035 times

last updated: 23 Dec '13, 12:45