Forum Replies Created
-
AuthorPosts
-
peterlaursen
ParticipantPlease give us a few days (till mid next week). Since 8.1 release we are flooded with support request like 'please tell me how can I upgrade' etc. We will plan *what is next* when things have calmed down a little!
peterlaursen
Participant2) Here the problem is that from ALTER PROCEDURE it is actually possible to change the procedure name as well (you can edit anything). That was the reason why we did not do in 8.1. Any suggestions?
peterlaursen
ParticipantI think this may be some 'extension' to standard Windows behaviour invented by the Mozilla project or others. But it makes sense!
peterlaursen
Participantok .. understood. But why don't you keep the dialogue open?
peterlaursen
ParticipantThe place you posted is fine!
Please tell the program version you are using. I think we fixed an issue like this (but right here I do not recall exactly when and exact details about what the issue was). It you have free upgrades to 8.1 please try it .. or alternatively try the 8.1 TRIAL to back up those two tables (with the TRIAL you can only back up 2 tables per job).
Technically the server does not necessesarily 'die' (if you mean crash). Maybe it disconnects the client (SJA).
It may also be a server bug you encounter (and if the server crashes it *is* a server bug). So what is the server versions?
peterlaursen
ParticipantEven with 2 different SQLyog instances this is almost impossible. If only it can be guarateed that a single client will write to the database (and that is practically never the case) it will be possible to implment client-side.
You will find solutions. Often they are named 'auditing software' or 'auditing solutions'. They will need to be installed on the server. I think they will use the general log with some log rotation system , extract information from it and insert information to ts own database on the server (or they may even require that server is compiled with some extensions adding such system tables). In principle it is not much different from what we do in MONyog with the Query Analyzer, but as this one focuses on performance and not auditing we do not extract that information from the log. So should we consider this it would be part of MONyog – not SQLyog.
A google search with 'auditing +mysql':
http://www.google.com/search?client=opera&…-8&oe=utf-8
.. finds more questions and requests than solutions and answers! And if you find a solution it may not be very well-featured in 'stored programs' support but will mostly focus on tables (CREATE/DROP/ALTER tables and databases). Expect it to be quite expensive and mostly with a subscription-based license model.
Basically the problem is that MySQL is not designed for it. Oracle is as I read some of the above links.
peterlaursen
ParticipantYou have a PM!
peterlaursen
ParticipantJust resize the column in the table header (like you would do with a spreadsheet program). The column width you define will be used from then (also across sessions). The column width persistence in GRID was mostly done in 8.03. Changelogs:
“New major feature: column width persistence in GRIDs. Once you have defined a column width for a combination of database/table/column the defined column width will always be used. Note that connection details are not used for identifying columns with this new functionality so with replicated and identically named synchronized databases it is sufficient to define in one place. Alias’ed columns in results are handled by the column name and not the alias. Non-column results (like constants, results of expressions/functions, returns of SHOW etc.) are not supported currently. The feature can be turned on/off. Note that if both this new option and the old ”Truncate column headers … ” is checked in program ‘preferences’ the “Truncate ..” option will be ‘overridden’ by the new column width persistence feature.”
I cannot tell how it became like that on your system . It never was for me. Maybe you fingers slipped on the mouse/touchpad? Anyway please confirm that resizing once will fix this.
But there is something to look into for us too I think. That is that with such EXPLAIN all columns will take the same width (probably because output is not table data).
June 3, 2009 at 11:10 am in reply to: Plaintext Resultset Doesn't Align The Columns Properly When Utf8 I #29028peterlaursen
ParticipantWe know this issue. 2-byte characters will take 2 positions.
peterlaursen
ParticipantWe have request for integration in version control systems before and we have this recorded:
http://code.google.com/p/sqlyog/issues/detail?id=492
But your request is different. And impossible to implement. For two reasons:
1) SQLyog does not know what other clients are doing
2) A client cannot do this as the server does not expose such information for clients. The server has no records of objects history (unless exposed in the general query log and this will practically never be complete for objects history from the 'very beginning'). And a client cannot even read the general log (only an Operating System user can)-
What we *could* do was to implement some version control for SQL scripts handled by SQLyog. This will make good sense if SQLyog *alone* is used for development of a database application (but will fail if other clients than SQyog are used). But even this is not planned for near future.
peterlaursen
Participant1) We will add the databasename to the ALTER.. templates in 8.1
2) We will not recreate the privileges in the 8.1 release. It is feature-frozen now.
*
The main reason is that this is executed from the editor and we should not execute SQL statements that are not displayed to user whne executing from the editor. However iIt is no major technical difficulty to
1) SELECT from mysql.procs_priv where Routine_name = …
2) do the ALTER
3) INSERT again to mysql.procs_priv (except for timestamp column I think) and FLUSH PRIVILEGES (only if user changes the name of the procedure it will fail)
.. also we could add the INSERT+FLUSH privileges to the editor after teh CREATE statment so that user could see them. That would be correct – executing in background without exposing to the user would be wrong.
*
Additionally this is basically an issue with MySQL. Refer to http://dev.mysql.com/doc/refman/5.0/en/alter-procedure.html
MySQL has an ALTER PROCEDURE statement (that actually does preserve privileges) but with severe restrictions: “However, you cannot change the parameters or body of a stored procedure using this statement; to make such changes, you must drop and re-create the procedure using DROP PROCEDURE and CREATE PROCEDURE.” So basically this is a request for MySQL (the server supplier) and not for Webyog (the client provider)! But a client-side 'workaround' is possible as described. But as told we will likely not in 8.1
*
Actually only very few users GRANT privileges for individual procedures (and with small SP's executed often is also is a bad idea for performance reasons because the server will first check global privileges, next database privileges and finally object/routine privileges). The 'higher level' you can define privileges the better the server performance.
3)
Personally I think we should pay attention to the 'interactive flag' as priority after 8.1
4)
Trigger objects in table folder in Object Browser. Well .. we had this request a few times. Actually I agree that if you use triggers a lot, diplaying dozens or hundreds of triggers 'database level' can be rather hard to use. Maybe we can optionally 'display link to triggers in tables'.
peterlaursen
ParticipantCtrl+T shortcut is also there!
peterlaursen
Participantcorrection: you will of course need MySQL 5.0 or higher to use a Stored Procedure. But no problem as you use 5.1.30.
peterlaursen
Participant1) The link to the Stored Procedure in the other Forums post needed not much modification (only changing column naems and correcting a typo). This will work (on 4.1 + servers) with your example:
USE `test`;
— we prepare a temporary table where we import the CSV
DROP TABLE IF EXISTS `bd_delete`;
CREATE TABLE `bd_delete` (
`insc` INT(8) NOT NULL DEFAULT '0',
`nome` TEXT,
PRIMARY KEY (`insc`)
) ENGINE=MYISAM DEFAULT CHARSET=latin1;
LOAD DATA LOCAL INFILE 'D:\csvcase\ll.csv' INTO TABLE `test`.`bd_delete` FIELDS ESCAPED BY '\' TERMINATED BY ',' ENCLOSED BY '”' LINES TERMINATED BY 'rn' (`insc`, `nome`);
— create a Stored Procedure that reads from the temporary table and updates the permanent table
DROP PROCEDURE IF EXISTS `test`.`csvfix`;
DELIMITER $$
CREATE PROCEDURE `test`.`csvfix`()
BEGIN
DECLARE my_id INTEGER;
WHILE ((SELECT COUNT(*) FROM `test`.`bd_delete`) > 0) DO
SET my_id = (SELECT `insc` FROM `bd_delete` ORDER BY `insc` LIMIT 1);
UPDATE `bd` SET `nome`= (SELECT `nome` FROM `bd_delete` ORDER BY `insc` LIMIT 1)
WHERE `insc` = (SELECT `insc` FROM `bd_delete` ORDER BY `insc` LIMIT 1);
DELETE FROM `bd_delete` WHERE `insc` = my_id;
END WHILE;
END$$
DELIMITER ;
— let us see what data are there: the permanent table
SELECT insc, nome, pontos FROM bd WHERE insc IN (67126137, 67130667, 67107434);
/*
insc nome pontos
67107434 Paulo Igor Bosco Silva 74
67126137 Roberio Rodrigues Araujo (candidato Sub Judice) 74
67130667 Welton Da Costa Marcal 74
*/
— the temporary table
SELECT insc, nome FROM bd_delete WHERE insc IN (67126137, 67130667, 67107434);
/*
insc nome
67107434 Peter Lausen
67130667 Joaquim
67126137 Paulino
*/
— execute the stored procedure
CALL `test`.`csvfix`();
— verification that UPDATES were the right one:
SELECT insc, nome, pontos FROM bd WHERE insc IN (67126137, 67130667, 67107434);
/*
insc nome pontos
67107434 Peter Lausen 74
67126137 Paulino 74
67130667 Joaquim 74
*/
— cleanup
DROP PROCEDURE IF EXISTS `test`.`csvfix`;
DROP TABLE IF EXISTS `bd_delete`;
— note: this particular example handles UPDATES only .. if you sometimes have new columns too you need use INSERT .. ON DUPLICATE KEY UPDATE …
— but I really do not understand why you copy back and forth to Excel so that all this is necessary. Wasn't it easier to develop a small database application that could do to the database what you now do in Excel?
2) A few general comments: your schema has some common beginner's mitakes, I think
first: You are using TEXT types for short strings types where you should use char(n). We see that often when users use an old, crap (I mean more crappy than what it needs to be!) and 'cracked' (?) Navicat version. TEXT types in MySQL are intended for very long strings (it is similar to an Access 'note' and not an Access 'text' .. why may be one reason why it is confused)
second: You use integer types like an INT(8). This will not be shorter than a plain INT in the database .. only the display will be truncated when the server returns it to a client. If that is what you want it is OK, but in 99,9% of cases we see this users just do not understand the length specification of an INTEGER type!
BTW: how can it be that you are still using “SQLyog Enterprise Trial – MySQL GUI v7.5 Beta2″ ?
3) With this particular example some 'replace into table from CSV' would not be hard to code as a simple GUI implementation. User would need to map each column in the file to a column in the table. The PK-columns will be used for the WHERE clause and the rest for UPDATE .. SET. But that was also basically what I did with the SP example. Actually a small script/application reading the file would be even simpler (but I am not sure if you have a scripting enviroment from where you can connect to MySQL). I did not promise that we will do it, but let us discuss! Personally I think users would be better off learning to write such very simple logic in some sort of code – but I realize that some people don't want to!
-
AuthorPosts