Forum Replies Created
-
AuthorPosts
-
peterlaursen
ParticipantCan you tell the server versions: both source and target? (get it from “SELECT version()” or SQLyog menu .. tools .. show .. variables
This:
CREATE TABLE `scgroupaccess` (
`siteid` varchar(5) NOT NULL DEFAULT '',
`groupid` varchar(25) NOT NULL,
`item` varchar(5) NOT NULL,
`accesstype` char(1) NOT NULL,
`systemid` varchar(5) NOT NULL,
PRIMARY KEY (`siteid`,`groupid`,`item`,`systemid`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=latin1
..works fine for me on 5.1.35.
Try to omit both
“USING BTREE”
and
“ENGINE=MyISAM DEFAULT CHARSET=latin1”
I am not sure when USING was introduced for indexes in MySQL, ENGINE and table-level CHARSET parameters were introduced in 4.1.
So which of those work and which don't?
1:
CREATE TABLE `scgroupaccess` (
`siteid` varchar(5) NOT NULL DEFAULT '',
`groupid` varchar(25) NOT NULL,
`item` varchar(5) NOT NULL,
`accesstype` char(1) NOT NULL,
`systemid` varchar(5) NOT NULL,
PRIMARY KEY (`siteid`,`groupid`,`item`,`systemid`) USING BTREE
)
2:
CREATE TABLE `scgroupaccess` (
`siteid` varchar(5) NOT NULL DEFAULT '',
`groupid` varchar(25) NOT NULL,
`item` varchar(5) NOT NULL,
`accesstype` char(1) NOT NULL,
`systemid` varchar(5) NOT NULL,
PRIMARY KEY (`siteid`,`groupid`,`item`,`systemid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3:
CREATE TABLE `scgroupaccess` (
`siteid` varchar(5) NOT NULL DEFAULT '',
`groupid` varchar(25) NOT NULL,
`item` varchar(5) NOT NULL,
`accesstype` char(1) NOT NULL,
`systemid` varchar(5) NOT NULL,
PRIMARY KEY (`siteid`,`groupid`,`item`,`systemid`)
)
peterlaursen
ParticipantAlso you do not happen to have a Primary Key defined on a FLOATING POINT datataype (float, double or decimal with early MySQL versions) ?
peterlaursen
ParticipantWe have no record of such bug. I am afraid we will need some more info here. Maybe you could share the schema's an a few rows (export as CSV for instance) that fail to be transferred? You may create a ticket for privacy.
Also tell the MySQL server versions and the ODBC driver version. Did you try both MyODBC 3.x and 5.1? (I think I understand that both source and target are MySQL servers).
Also if you try once more no rows are tranferred this time?
peterlaursen
ParticipantThis is a reply that I am not 100% sure about (but 99.5% sure). I think you scroll faster than data can be 'spooled' in the data buffer. The SQLyog GRID is designed to 'animate' the scrolling ,ie. it loads while you are scrolling and displays *while scrolling* , but the larger the number of rows the more rows every millimeter of the scroll bar corresponds to.
workarounds:
1) keep the mouse at the end position for a while.
2) switch to text-mode (ctrl+l) and scrolling is much faster. But the switching also will take time.
However basically and personally I do not think it makes sense to display so many rows at a time. I would use the LIMIT/'rows in a range option' setting with << and >> buttons. Or work from RESULT tab filtering with a WHERE-clause. That is what kind of operation the program is designed for.
But I will discuss with the team if we could either:
1) make the animated mode optional, so that it will simplyonly start loading when you release the scroll button
2) automatically turn off that animated mode if it 'lacks behind' too much.
(but now sure that the internal buffer allow for neither 1) or 2) – we may use some kind of a linked list for the buffer where it is not really possible)
3) or it could remember where you released .. and then it will animate to that position at least
Just my curiousity: have you tried another GRID-based program (Excel or another spreadsheet) with equally many rows?
peterlaursen
Participant“happens with an empty table only”. Actually when syncing to an empty table we use basically the same copy as when exporting.
But I also noticed different charsets. Actually we do not prevent syncing tables with different charsets. But not sure either that this is an issue. But it could be if there are utf8-characters in source that cannot be handled in latin1. Or maybe two utf8 characters that are mapped to the same byte-value in different single-byte encodings. I tried
Why do you create tables with different charsets? Also (with reference to you other post here today): Do you use 'export as ..' or 'backup as sql-dump' ?? Only the latter will create engine and charset parameters as they wer originally defined in source.
edit: I removed a mistakeof mine here. But please ensure that the .sql file has a utf8 charset specification like the table you export from. 'backup as sql-dump' will write this – 'export as ..SQL' will not.
peterlaursen
ParticipantSQLyog does not expect anything like that. It only reads data. I am only trying to find some entry to the problem! If table is NOT NULL and name =
it is likely becuase global sql_mode is *strict* and session sql_mode for the application is '' (empty mode). But also SQLyog sets an empty sql_mode. And still it should not matter. If you are telling that problems occur with a fresh installation of this application (where the 2 first rows are created) there must be some difference between the table created by the application and the table you just created.
Quote:I did retest an entire database export/import and cannot reproduce the error (it has only happened a couple times over a month). But I always get the error with every sync job.I understand with both sync to an empty and an non-empty table?
No clue at the moment. But please also tell
1) the server versions (both source and target – probably unimportant though).
2) is the database used by the application while syncing? Data sync does not take a 'snapshot' of each table, but 'chews its way' through it from one end (and actually I also think backup/export does). Also this we should have handled but that is just an idea right at the moment. The 'duplicate' indicates that an INSERT-attempt is performed that should have been an UPDATE attempt. Can you afford to try stop the application from connecting the database while syncing?
With 'dump' you have LOCK and FLUSH LOGS options. With Data Sync there is not (but we have discussed adding it).
peterlaursen
Participantand “Export table data/result as…” is not intended for backup of tables but for exporting result sets (actually if you use it with a table a warning popup will display).
peterlaursen
Participant1) I first wrote this
Please tell the program version! And also if you are using HTTP tunnel.
There were some fixes with 'duplicate key' error earlier. But I understand you also get this error during import. Do you use SQLyog for both export and import?
I will ask you to provide a test case. Can you do like this
Code:CREATE newtable AS SELECT * from oldtable WHERE uid=0 or uid=1.. and next create exactly the same indexes on 'newtable' as on 'oldtable' .. if not the 'duplicate error' comes again.
Next export/dump 'newtable' .. drop 'newtable'. Can you now import it?
2) but next I noticed
UNIQUE KEY `name` (`name`),
.. so it could be an issue with that key and not the Primary Key. What does the content of 'name' look like for column 0 and column 1? And is 'name' column declared NULL or NOT NULL?
peterlaursen
Participantyes and yes!
As regards the second question you are the one who can best judge. You may have several versions intalled in parallel to different folders.
peterlaursen
ParticipantPlease wait for the developer team to comment. Manohar has not been working with SQLyog for more than a year (he is with MONyog now), so this is a little bit strange.
peterlaursen
ParticipantIt gets created as InnoDB in your case because this is the default setting for this particular server. Can't you change the server default??
A setting in SQLyog 'preferences' ahs the problem that you cannot always tell what table types ('engines') is available for a server (it is not a big problem at the moment, but it will increasing be with Maria, PBXT, ExtraDB and Falcon etc. engines spreading in both offcal an unoffical mySQL builds). So ideally it should then be a 'per server' setting, I think.
peterlaursen
ParticipantThe characters must be escaped so correct is
“SELECT * FROM Table1 where column1 between #### AND #### INTO OUTFILE 'E:\Test.SQL';”
(Windows file paths are a litle inconvenient in MySQL)
peterlaursen
ParticipantAnd I forgot this: SQLyog Pro was abandoned around 3 years ago. Notifications Services is an 'Enterprise' feature. It was not in 'Pro' and is not in 'Community'.
We offer PRO users to purchase ENTERPRISE at upgrade price. Please contact us through the ticket system if you are interested.
peterlaursen
ParticipantBasically it is a problem with the MySQL itself.
This is a good summary of the problems:
http://www.google.com/search?client=opera&…-8&oe=utf-8
Or as the MySQL documentation says here: http://dev.mysql.com/doc/refman/5.0/en/bit-field-values.html
“Bit values are returned as binary values.” BOOM! 🙂
But the solution is also there: “To display them in printable form, add 0 or use a conversion function such as BIN().”
say you have a col1 that is INT and a col2 that is BIT(n) you may do:
Code:SELECT col1, bin(col2) FROM thetableor
Code:SELECT col1, col2+0 FROM thetableand data will be displayed in the the RESULT tab (but also note the pasage from documentation as regards the bin() function “High-order 0 bits are not displayed in the converted value”).
To INSERT or UPDATE I think the b'..' notation is most useful so that SQL like this is generated
Code:INSERT INTO t SET b = b'11111111';Actually BIT type is only part of the problem. Problem also is with any data returned by the server as a binary string (such as BINARY and VARBINARY where HEX-notation would be the only meningfull representation unless it is plain ASCII). User and client will need to handle it.
We have this recorded already: http://code.google.com/p/sqlyog/issues/detail?id=15. We did not find a solution for a safe way of doing it transparently for user.
peterlaursen
Participantgracias!
-
AuthorPosts