Re: Update to Percona CVE-2016-6662 Vulnerability Communication

2016-09-15 Thread Reindl Harald
Am 16.09.2016 um 00:21 schrieb Johan De Meersman: - Original Message - From: "Reindl Harald" Sent: Friday, 16 September, 2016 00:12:26 frankly - mysqld_safe needs to go away and life is beautiful without for years here and yes taht worked for mysql too before

Re: Update to Percona CVE-2016-6662 Vulnerability Communication

2016-09-15 Thread Johan De Meersman
- Original Message - > From: "Reindl Harald" > Sent: Friday, 16 September, 2016 00:12:26 > > frankly - mysqld_safe needs to go away and life is beautiful without for > years here and yes taht worked for mysql too before switch to MariaDB > > to say it clear:

Re: Update to Percona CVE-2016-6662 Vulnerability Communication

2016-09-15 Thread Reindl Harald
Am 16.09.2016 um 00:05 schrieb Johan De Meersman: This is probably of interest to many of you, and I've not seen it on the list yet. Kenny Gryp's blog about the vulnerability is at https://www.percona.com/blog/2016/09/12/database-affected-cve-2016-6662/ . For those who use it, there's an

Fwd: Update to Percona CVE-2016-6662 Vulnerability Communication

2016-09-15 Thread Johan De Meersman
into mysqld_safe at https://github.com/meersjo/ansible-mysql-cve-2016-6662 . /Johan - Forwarded Message - From: "Percona" <em...@percona.com> To: perc...@tuxera.be Sent: Wednesday, 14 September, 2016 00:42:18 Subject: Update to Percona CVE-2016-6662 Vulnerability Communication Earlie

update, insert ... gee.. a puzzle

2016-03-19 Thread lejeczek
.. that you experts I hope can crack like a digestive biscuit... how does one update, or merge or whatever is right technical term for it - a my.table from my.another table (both are schematically identical, no foreign keys, one primary key) but.. does it a way so when there is a duplicate

Re: update, insert ... gee.. a puzzle

2016-03-18 Thread Hal.sz S.ndor
2016/03/17 12:47 ... lejeczek: .. that you experts I hope can crack like a digestive biscuit... how does one update, or merge or whatever is right technical term for it - a my.table from my.another table (both are schematically identical, no foreign keys, one primary key) but.. does it a way

SUPER privilege required for simple update

2015-05-09 Thread Peter Abplanalp
hello, I have a replication client where replication stopped because mysql said that the SUPER privilege was required for an update statement. I tried running the same update under a normal user and it also failed saying the SUPER privilege was required. I thought the SUPER privilege was only

Re: SUPER privilege required for simple update

2015-05-09 Thread Johnny Withers
It's there an update trigger defined on the table? It could be doing something that requires the super privilege. On May 9, 2015 3:12 AM, Peter Abplanalp pabplan...@accucode.com wrote: hello, I have a replication client where replication stopped because mysql said that the SUPER privilege

update and control flow

2014-12-09 Thread Martin Mueller
I'm trying to get my feet wet with 'if' and 'when' uses in mysql. it would be very useful for update operations, but I can't get it right. If I read the documentation correctly, it should be possible to say something like UPDATE X if WORD like 'a%' SET COMMENT = 'a' elseif WORD like 'b%' SET

Re: update and control flow

2014-12-09 Thread wagnerbianchi.com
You can do that, but, perhaps the only chance to have it updating a row based on a condition is developing a Stored Procedure or even having a BEFORE Trigger associated with the main table. Those ways, you can test the sent value and decide on what UPDATE you will execute afterwards. Consider

Re: update and control flow

2014-12-09 Thread Michael Dykman
it updating a row based on a condition is developing a Stored Procedure or even having a BEFORE Trigger associated with the main table. Those ways, you can test the sent value and decide on what UPDATE you will execute afterwards. Consider that this is just an opinion since I'm not part

Re: update and control flow

2014-12-09 Thread shawn l.green
Hello Martin, On 12/9/2014 9:25 AM, Martin Mueller wrote: I'm trying to get my feet wet with 'if' and 'when' uses in mysql. it would be very useful for update operations, but I can't get it right. If I read the documentation correctly, it should be possible to say something like UPDATE X

Re: update and control flow

2014-12-09 Thread hsv
2014/12/09 14:25 +, Martin Mueller I'm trying to get my feet wet with 'if' and 'when' uses in mysql. it would be very useful for update operations, but I can't get it right. If I read the documentation correctly, it should be possible to say something like UPDATE X if WORD like 'a%' SET

Cannot Update, at least not how I'm telling it to!

2014-07-09 Thread Surya Savarika
| ++---+-+-+ 2 rows in set (0.00 sec) mysql update unions_data set Title='Dos' and Description='dos' where ID=5; ERROR 1292 (22007): Truncated incorrect DOUBLE value: 'Dos' mysql update unions_data set Title=2.2 and Description='dos' where ID=5; Query OK, 1 row affected (0.33 sec) Rows matched: 1

Re: Cannot Update, at least not how I'm telling it to!

2014-07-09 Thread Martijn Tonies (Upscene Productions)
The AND in your UPDATE clause makes this a logical operator instead of being a SQL keyword. Your syntax is wrong: UPDATE ... SET mycol = value, mycol2 = value [WHERE ... ] With regards, Martijn Tonies Upscene Productions http://www.upscene.com Download Database Workbench for Oracle, MS SQL

Problem with INSERT INTO and UPDATE queries

2014-06-25 Thread Antonio Fernández Pérez
​Hi list, I have some problems with INSERT INTO and UPDATE queries on a big table. Let me put the code and explain it ... I have copied the create code of the table. This table has more than 1500 rows. ​Create Table: CREATE TABLE `radacct` ( `RadAcctId` bigint(21) NOT NULL AUTO_INCREMENT

Re: Conditional in update

2014-02-12 Thread hsv
2014/02/11 18:14 -0500, Larry Martell set LIMIT = sign(LIMIT) * 100 * floor(0.01 + (sign(LIMIT) * LIMIT * ratio/100) The function TRUNCATE can be useful here: set LIMIT = TRUNCATE(LIMIT * ratio + 0.01 * sign(LIMIT), -2) , if it works as advertized. In any case, ABS(LIMIT) = sign(LIMIT)

Re: Conditional in update

2014-02-12 Thread Larry Martell
was able to do this with a case statement, but then the requirements were changed and I had to know when I constrained the limit so I could log it to a file. So I ended up just doing the update as it was originally, then adding a select after to find any rows that exceeded the limit, and then updating

Conditional in update

2014-02-11 Thread Larry Martell
Is there some way I can have a conditional in an update? I have this update sql (paraphrased): update LMPROC_LIMITS set LIMIT = sign(LIMIT) * 100 * floor(0.01 + (sign(LIMIT) * LIMIT * ratio/100) where SYMBOL_ID = symbolId and CLASSTYPE = LimitType and TYPE_ in ('minClusterPosition

Re: Update Column in table only if variable is Not NULL

2013-10-30 Thread Neil Tompkins
Shawn What I need is that if I pass say 10 parameters/variables to a query, I only want to update the column/field if the value passed is NOT NULL. On Wed, Oct 30, 2013 at 3:41 AM, Shawn Green shawn.l.gr...@oracle.comwrote: Hi, On 10/29/2013 9:52 PM, h...@tbbs.net wrote: 2013/10/29 11:35

Re: Update Column in table only if variable is Not NULL

2013-10-30 Thread Shawn Green
Hi Neil, On 10/30/2013 9:55 AM, Neil Tompkins wrote: Shawn What I need is that if I pass say 10 parameters/variables to a query, I only want to update the column/field if the value passed is NOT NULL. On Wed, Oct 30, 2013 at 3:41 AM, Shawn Green shawn.l.gr...@oracle.comwrote: Hi, On 10

Re: Update Column in table only if variable is Not NULL

2013-10-29 Thread Michael Dykman
Consider: update table1 set field1 = if( :var,:var,field1), ... Can be in a procedure but doesn't have to be. On Oct 28, 2013 5:28 PM, Neil Tompkins neil.tompk...@googlemail.com wrote: Hi Shawn Thanks for your reply. Maybe my example wasn't detailed enough. Basically the snippet

Re: Update Column in table only if variable is Not NULL

2013-10-29 Thread Shawn Green
Hello Neil, On 10/28/2013 5:23 PM, Neil Tompkins wrote: Hi Shawn Thanks for your reply. Maybe my example wasn't detailed enough. Basically the snippet of the UPDATE statement I provided shows updating only 1 field. However in my live working example, I have about 20 possible fields

Re: Update Column in table only if variable is Not NULL

2013-10-29 Thread hsv
2013/10/28 21:23 +, Neil Tompkins Basically the snippet of the UPDATE statement I provided shows updating only 1 field. However in my live working example, I have about 20 possible fields that might need to be updated if the variable passed for each field is NOT NULL. Well, maybe

Re: Update Column in table only if variable is Not NULL

2013-10-29 Thread hsv
2013/10/29 11:35 -0400, Shawn Green My favorite technique is the COALESCE function for this on a column-by-column basis SET FieldName1 = Now(), FieldName2 = COALESCE(:MyVariable, FieldName2) but if MyVariable is NULL, FieldName1 reflects the attempt to change, not change. -- MySQL

Re: Update Column in table only if variable is Not NULL

2013-10-29 Thread Shawn Green
the attempt to change, not change. The way I understood the second explanation was like this. He wants to update a row of data. The FieldName1 field is always updated to the current date and time. If any of the new values (passed in via variables) are not NULL for a specific column, replace

Update Column in table only if variable is Not NULL

2013-10-28 Thread Neil Tompkins
Hi If I have a update statement like UPDATE MY_TABLE SET FieldName1 = Now(), FieldName2 = :MyVariable WHERE FieldName3 = 'Y' How can I only update the FieldName2 field if the value of MyVariable is NOT NULL ? Thanks Neil

Re: Update Column in table only if variable is Not NULL

2013-10-28 Thread Andy Wallace
Try: update my_table set fieldname1 = Now(), Fieldname2 = :myVariable where Fieldname3 is not null On 10/28/13 11:06 AM, Neil Tompkins wrote: Hi If I have a update statement like UPDATE MY_TABLE SET FieldName1 = Now(), FieldName2 = :MyVariable WHERE FieldName3 = 'Y' How can I only update

Re: Update Column in table only if variable is Not NULL

2013-10-28 Thread Shawn Green
Hello Neil, On 10/28/2013 2:06 PM, Neil Tompkins wrote: Hi If I have a update statement like UPDATE MY_TABLE SET FieldName1 = Now(), FieldName2 = :MyVariable WHERE FieldName3 = 'Y' How can I only update the FieldName2 field if the value of MyVariable is NOT NULL ? Thanks Neil This needs

Re: Update Column in table only if variable is Not NULL

2013-10-28 Thread Neil Tompkins
Hi Shawn Thanks for your reply. Maybe my example wasn't detailed enough. Basically the snippet of the UPDATE statement I provided shows updating only 1 field. However in my live working example, I have about 20 possible fields that might need to be updated if the variable passed for each field

Re: How to update MySQL table based on 3 other tables

2013-09-03 Thread shawn green
Hello Neil, On 8/24/2013 5:21 AM, Neil Tompkins wrote: I have the following four MySQL tables Region RegionId City CityId RegionId Hotel HotelId CityId HotelRegion HotelId RegionId I'm struggling to write a UPDATE statement to update the City table's RegionId field from data

How to update MySQL table based on 3 other tables

2013-08-24 Thread Neil Tompkins
I have the following four MySQL tables Region RegionId City CityId RegionId Hotel HotelId CityId HotelRegion HotelId RegionId I'm struggling to write a UPDATE statement to update the City table's RegionId field from data in the HotelRegion table. Basically how can I update the City table

Update just some of the fields

2013-06-17 Thread Sayyed Mohammad Emami Razavi
In MySQL when i execute full update query, all fields will be updated or no? It means, which fields that have not been changed will not be updated?! e.g. current values for table named 'test', i want to update just desc: id, name, desc 1, test1, test2 update test set name='test1', desc='test10

Re: Update just some of the fields

2013-06-17 Thread hsv
2013/06/17 11:38 +0430, Sayyed Mohammad Emami Razavi update test set desc='test10' where id=1; _That_ is UPDATE! It is the only means of changing, but neither inserting nor deleting, a record. The other fields are left the same. MySQL also tracks whether it is an actual change

Re: update a row only if any column has changed, in a very large table

2013-04-08 Thread Andrés Tello
Take a look here. http://dev.mysql.com/doc/refman/5.0/en/timestamp-initialization.html timestamp field can be autoupdated and autoinitilizated With both DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP, the column has the current timestamp for its default value and is automatically

RE: Update and lock question.

2013-04-08 Thread Rick James
2:56 PM To: Urvashi Pathak Cc: mysql Subject: Re: Update and lock question. Thanks Urvashi. Based on your answer, instead of the data I looked into the index, and it appears that it was an index issue... I think I have nailed the wait lock contdition due a updating indexes unnecesarely

update a row only if any column has changed, in a very large table

2013-04-06 Thread Rajeev Prasad
hello, I have a table with around 2,000,000 records (15 columns). I have to sync this from an outside source once everyday. not all records are changed/removed /new-added everyday. so what is the best way to update only those which have changed/added/or deleted? i can use update_or_create

RE: update a row only if any column has changed, in a very large table

2013-04-06 Thread Jason Trebilcock
- From: Rajeev Prasad [mailto:rp.ne...@yahoo.com] Sent: Saturday, April 06, 2013 3:57 PM To: mysql list Subject: update a row only if any column has changed, in a very large table hello, I have a table with around 2,000,000 records (15 columns). I have to sync this from an outside source once

RE: Update and lock question.

2013-04-06 Thread Urvashi Pathak
Hi Andrés, Select for update makes sure that no other process can change the data between you selected it for update and then actually changed it and commit it. If you do not use select for update then it is possible that some other process can change the data in the mean time between you

Re: update a row only if any column has changed, in a very large table

2013-04-06 Thread hsv
2013/04/06 13:56 -0700, Rajeev Prasad I have a table with around 2,000,000 records (15 columns). I have to sync this from an outside source once every day. not all records are changed/removed /new-added everyday. so what is the best way to update only those which have changed/added/or deleted

Re: update a row only if any column has changed, in a very large table

2013-04-06 Thread Rajeev Prasad
thx all, the source data is in text file. - Original Message - From: h...@tbbs.net h...@tbbs.net To: mysql list mysql@lists.mysql.com Cc: Sent: Saturday, April 6, 2013 8:02 PM Subject: Re: update a row only if any column has changed, in a very large table 2013/04/06 13:56 -0700

Update and lock question.

2013-04-05 Thread Andrés Tello
I'm doing some tests, but have a questions about locking. In a innodb table, if you issue an select for update lock for a row, supposedly, it only locks that row, but if you don't issue a select for update, and trow the update... does it locks the hole table? The update goes over an indexed

Re: Update and lock question.

2013-04-05 Thread Andrés Tello
wrote: Hi Andrés, Select for update makes sure that no other process can change the data between you selected it for update and then actually changed it and commit it. If you do not use select for update then it is possible that some other process can change the data in the mean time

Update One of Three tables in a single query

2012-11-30 Thread Chris W
for the corresponding table. Only I don't know which one. Is there a way to write a single update statement that will update only the one table that has the matching ID? I have tired a few different ideas but none seem worth mentioning here since they all either update too many records or don't

Re: Update One of Three tables in a single query

2012-11-29 Thread Andrew Moore
a single update statement that will update only the one table that has the matching ID? I have tired a few different ideas but none seem worth mentioning here since they all either update too many records or don't update any records. Thanks for the help. Chris W -- MySQL General Mailing List

RE: Update One of Three tables in a single query

2012-11-29 Thread Rick James
Some combo of IN, EXISTS, UNION? It will probably be verbose. -Original Message- From: Andrew Moore [mailto:eroomy...@gmail.com] Sent: Thursday, November 29, 2012 11:32 AM To: Chris W Cc: MYSQL General List Subject: Re: Update One of Three tables in a single query What's your

Re: update doesn't

2012-08-20 Thread Mogens Melander
line client, run the UPDATE statement, en then check what the SELECT shows? If it shows a correct result... the problem ain't in MySQL itself. mysql select status from tasks; ++ | status | ++ | W | ++ 1 row in set (0.00 sec) mysql update tasks set status= 'H

Re: update doesn't

2012-08-20 Thread william drescher
. Can you connect with the command line client, run the UPDATE statement, en then check what the SELECT shows? If it shows a correct result... the problem ain't in MySQL itself. mysql select status from tasks; ++ | status | ++ | W | ++ 1 row in set (0.00 sec) mysql

Re: update doesn't

2012-08-19 Thread william drescher
. Does SHOW TRIGGERS; show any that could be doing this? 2) However, in 99.999% of cases, it is just a logic error in the application (be it your application or PHPMyAdmin), not anything in MySQL. Can you connect with the command line client, run the UPDATE statement, en then check what the SELECT

Re: update doesn't

2012-08-19 Thread Johnny Withers
The client indicates a warning after the update. Issue a show warnings after the update. On Aug 19, 2012 11:19 AM, william drescher will...@techservsys.com wrote: On 8/17/2012 12:13 PM, Rik Wasmus wrote: I get 1 row affected, but the status does not change when I look at the row. If I set

Re: update doesn't

2012-08-19 Thread william drescher
On 8/19/2012 1:25 PM, Johnny Withers wrote: The client indicates a warning after the update. Issue a show warnings after the update. actually, it doesn't. but I did a show warnings and it replied: Empty Set (0.00 sec) I also did a show triggers and it replied: Empty Set (0.00 sec) On Aug 19

Re: update doesn't

2012-08-19 Thread william drescher
On 8/19/2012 5:56 PM, william drescher wrote: mysql select status from tasks; ++ | status | ++ | W | ++ 1 row in set (0.00 sec) mysql update tasks set status= 'H'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed 1 Warnings: 0 mysql select status

update doesn't

2012-08-17 Thread william drescher
I have a table (tasks) with: task_id mediumint(9) status char(1) priority char(1) and more fields when I do the following (using phpMyAdmin): update tasks set status='H' where task_id='1' I get 1 row affected, but the status does not change when I look at the row. If I set it to 'X

Re: update doesn't

2012-08-17 Thread Rik Wasmus
that could be doing this? 2) However, in 99.999% of cases, it is just a logic error in the application (be it your application or PHPMyAdmin), not anything in MySQL. Can you connect with the command line client, run the UPDATE statement, en then check what the SELECT shows? If it shows a correct

Which Database when lot of insert / update queries to execute

2012-06-15 Thread abhishek jain
hi, I am biased on mysql, and hence i am asking this on mysql forum first. I am designing a solution which will need me to import from CSV, i am using my JAVA code to parse. CSV file has 500K rows, and i need to do it thrice an hour, for 10 hours a day. The Queries will mainly be update

Re: Which Database when lot of insert / update queries to execute

2012-06-15 Thread Tsubasa Tanaka
, and hence i am asking this on mysql forum first. I am designing a solution which will need me to import from CSV, i am using my JAVA code to parse. CSV file has 500K rows, and i need to do it thrice an hour, for 10 hours  a day. The Queries will mainly be update but select and insert also at times

RE: Which Database when lot of insert / update queries to execute

2012-06-15 Thread Rick James
/ update queries to execute hi, I am biased on mysql, and hence i am asking this on mysql forum first. I am designing a solution which will need me to import from CSV, i am using my JAVA code to parse. CSV file has 500K rows, and i need to do it thrice an hour, for 10 hours a day. The Queries

Re: Which Database when lot of insert / update queries to execute

2012-06-15 Thread hsv
2012/06/15 18:14 +0900, Tsubasa Tanaka try to use `LOAD DATA INFILE' to import from CSV file. http://dev.mysql.com/doc/refman/5.5/en/load-data.html Try is the operative word: MySQL s character format is _like_ CSV, but not the same. The treatment of NULL is doubtless the biggest

RE: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Steven Staples
-Original Message- From: Andrés Tello [mailto:mr.crip...@gmail.com] Sent: May 12, 2012 10:08 AM To: mysql Subject: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this While doning a batch process... show full processlist show: | 544

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Ananda Kumar
is accountid a number or varchar column On Sat, May 12, 2012 at 7:38 PM, Andrés Tello mr.crip...@gmail.com wrote: While doning a batch process... show full processlist show: | 544 | prod | 90.0.0.51:51262 | tmz2012 | Query |6 | end | update `account` set

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Andrés Tello
or varchar column On Sat, May 12, 2012 at 7:38 PM, Andrés Tello mr.crip...@gmail.comwrote: While doning a batch process... show full processlist show: | 544 | prod | 90.0.0.51:51262 | tmz2012 | Query |6 | end | update `account` set `balance`= 0.00 + '-4000' where

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Ananda Kumar
a batch process... show full processlist show: | 544 | prod | 90.0.0.51:51262 | tmz2012 | Query |6 | end | update `account` set `balance`= 0.00 + '-4000' where accountid='2583092' No other process, lo locking no nothing... so you take this same query... run

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Johan De Meersman
- Original Message - From: Ananda Kumar anan...@gmail.com If numeric, then why are u using quotes. With quotes, mysql will ignore the index and do a full table scan Will it? Common sense dictates that it would convert to the column's native type before comparing; and a quick explain

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Ananda Kumar
I used to have these issues in mysql version 5.0.41. On Mon, May 14, 2012 at 8:13 PM, Johan De Meersman vegiv...@tuxera.bewrote: - Original Message - From: Ananda Kumar anan...@gmail.com If numeric, then why are u using quotes. With quotes, mysql will ignore the index and do a

Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-12 Thread Andrés Tello
While doning a batch process... show full processlist show: | 544 | prod | 90.0.0.51:51262 | tmz2012 | Query |6 | end | update `account` set `balance`= 0.00 + '-4000' where accountid='2583092' No other process, lo locking no nothing... so you take this same query

update query

2012-04-30 Thread Pothanaboyina Trimurthy
Hi all, i have one database with 120 tables and each table contains one common column that is client now i want to update all the tables column client = NEW. is it possible to write a single query to update this one. please help me. thanks in advance Thanks Kind Regards, Trimurthy.p

Re: update query

2012-04-30 Thread Ananda Kumar
Do you just want to replace current value in client column to NEW. You can write a stored proc , with a cursor and loop through the cursor, update each table. regards anandkl On Mon, Apr 30, 2012 at 2:47 PM, Pothanaboyina Trimurthy skd.trimur...@gmail.com wrote: Hi all, i have one

回复: update query

2012-04-30 Thread Zhangzhigang
use database;update $i set client='NEW'     fi     let c=$c+1 done 发件人: Ananda Kumar anan...@gmail.com 收件人: Pothanaboyina Trimurthy skd.trimur...@gmail.com 抄送: mysql@lists.mysql.com 发送日期: 2012年4月30日, 星期一, 下午 5:26 主题: Re: update query Do you just want

RE: update query

2012-04-30 Thread Rick James
= 'dbname' information_schema.COLUMNS WHERE COLUMN_NAME = 'client' -Original Message- From: Ananda Kumar [mailto:anan...@gmail.com] Sent: Monday, April 30, 2012 2:26 AM To: Pothanaboyina Trimurthy Cc: mysql@lists.mysql.com Subject: Re: update query Do you just want to replace

Re: Trying to update existing prices and sizes in products table

2012-03-14 Thread Baron Schwartz
Matthew, The mistake seems to be in believing that the alias from the SELECT carries over and is used in the UPDATE. You need to add an alias to the UPDATE. You are referring to _import_products in the UPDATE, but you never define it as an alias. On Tue, Mar 13, 2012 at 10:30 PM, Matthew Stuart

Re: Trying to update existing prices and sizes in products table

2012-03-14 Thread Claudio Nanni
Matthew, Baron, I am actually a bit confused,* what has the SELECT to do with the UPDATE?* SELECT ProductSku, COUNT(ProductSku) _import_products FROM _import_products GROUP BY ProductSku; I think the problem is simply that you are using two relations (tables) that are effectively the same

Re: preg_replace in update statement

2012-03-10 Thread Hal�sz S�ndor
2012/03/08 16:11 -0500, Hank I have a varchar field in the database, and I want to remove all text between WordA and WordB, including WordA and WordB, leaving all text before WordA and after WordB intact. Possible with just SQL? I know I can write a PHP program to do it, but it's not that

Re: preg_replace in update statement

2012-03-09 Thread Baron Schwartz
You may find this helpful: http://www.mysqludf.org/lib_mysqludf_preg/ On Thu, Mar 8, 2012 at 4:11 PM, Hank hes...@gmail.com wrote: I have a simple problem: I have a varchar field in the database, and I want to remove all text between WordA and WordB, including WordA and WordB, leaving all

RE: preg_replace in update statement

2012-03-09 Thread David Lerer
Try with a combination of functions LOCATE and SUBSTR. Locate will return the positions for WordA and WordB within the original text, and, SUBSTR will allow you to string what you you need all together. David. On Thu, Mar 8, 2012 at 4:11 PM, Hank hes...@gmail.com wrote: I have a simple

preg_replace in update statement

2012-03-08 Thread Hank
I have a simple problem: I have a varchar field in the database, and I want to remove all text between WordA and WordB, including WordA and WordB, leaving all text before WordA and after WordB intact. Possible with just SQL? I know I can write a PHP program to do it, but it's not that important

Re: preg_replace in update statement

2012-03-08 Thread Hank
They are regular words. I was hoping someone would already know how to do it. I was trying to avoid rolling my own solution using the string functions. It gets really messy, really quick. -Hank On Thu, Mar 8, 2012 at 8:18 PM, Michael Dykman mdyk...@gmail.com wrote: If your words need to be

problem after update with a second node (no cluster problem)

2012-02-23 Thread fatcharly
Hi, I´m running a mySQL-Cluster with drbd/pacemaker/heartbeat on two centOS 5.7. The old version was a mysql-server-5.0.77-4.el5_6.6 the new is mysql-server-5.0.95-1.el5_7.1. I tried to update the system with less downtime, so first update via yum was on the passive node (2 drbd-devices

Batch update

2012-02-14 Thread Alex Schaft
Hi, I need to update a table along the lines of the following update table set LastUpdate=now(), UpdateSource='Abc' Where Key1 = 'Def' and Key2 = 'ghi' I need to possible do anywhere from 2 to 20 of these. Would it be better to call an update statement for each of these, or should I do

Re: Batch update

2012-02-14 Thread carsten
On 14.02.2012 10:20, Alex Schaft wrote: Hi, I need to update a table along the lines of the following update table set LastUpdate=now(), UpdateSource='Abc' Where Key1 = 'Def' and Key2 = 'ghi' I need to possible do anywhere from 2 to 20 of these. Would it be better to call an update

Re: Batch update

2012-02-14 Thread Alex Schaft
On 2/14/2012 10:30 AM, cars...@bitbybit.dk wrote: On 14.02.2012 10:20, Alex Schaft wrote: Hi, I need to update a table along the lines of the following update table set LastUpdate=now(), UpdateSource='Abc' Where Key1 = 'Def' and Key2 = 'ghi' I need to possible do anywhere from 2 to 20

Delete from another table on update.

2012-02-06 Thread Paul Halliday
Is it possible to wrap a DELETE statement in an ON DUPLICATE KEY UPDATE? Something like: ON DUPLICATE KEY UPDATE host=b1 (DELETE FROM another_table WHERE host=b1) ? Thanks. -- Paul Halliday http://www.squertproject.org/ -- MySQL General Mailing List For list archives: http://lists.mysql.com

Re: Delete from another table on update.

2012-02-06 Thread Hal�sz S�ndor
2012/02/06 11:33 -0400, Paul Halliday Is it possible to wrap a DELETE statement in an ON DUPLICATE KEY UPDATE? Something like: ON DUPLICATE KEY UPDATE host=b1 (DELETE FROM another_table WHERE host=b1) ? No; see http://dev.mysql.com/doc/refman/5.5/en/insert.html Such things are done

Re: UPDATE triggers with REPLACE statements

2012-01-23 Thread Hal�sz S�ndor
; 20111219 03:42 PM -0800, Jim McNeely Not if you are using innoDB tables. For these, you use INSERT and UPDATE triggers. Jim McNeely On Dec 19, 2011, at 11:58 AM, Halász Sándor wrote: 2011/12/19 11:30 -0800, Jim McNeely In the MySQL documentation, we find this tantalizing statement

Re: UPDATE triggers with REPLACE statements

2011-12-19 Thread Jim McNeely
Perfect!! This is the answer I was looking for. Thanks! I didn't know about this. Jim McNeely On Dec 18, 2011, at 11:26 AM, Claudio Nanni wrote: Only if you can change the application you could use INSERTON DUPLICATE KEY UPDATE instead of REPLACE. Check Peter's post here: http

Re: UPDATE triggers with REPLACE statements

2011-12-19 Thread Jim McNeely
In the MySQL documentation, we find this tantalizing statement: It is possible that in the case of a duplicate-key error, a storage engine may perform the REPLACE as an update rather than a delete plus insert, but the semantics are the same. There are no user-visible effects other than

Re: UPDATE triggers with REPLACE statements

2011-12-19 Thread Claudio Nanni
Good to know and good that you took time to read the manual, good approach. But why bother with REPLACE if you will go with INSERT.ON DUPLICATE KEY UPDATE? The storage engine is a property of your table and you can set it and/or change it, it is the low-level layer (physical) of the database

Re: UPDATE triggers with REPLACE statements

2011-12-19 Thread Jim McNeely
With REPLACE, you just set up the query the same as an INSERT statement but otherwise it just works. With ON DUPLICATE UPDATE you have to set up the whole query with the entire text all over again as an update. The query strings for what I'm doing are in some cases pushing enough text

Re: UPDATE triggers with REPLACE statements

2011-12-19 Thread Hal�sz S�ndor
2011/12/19 11:30 -0800, Jim McNeely In the MySQL documentation, we find this tantalizing statement: It is possible that in the case of a duplicate-key error, a storage engine may perform the REPLACE as an update rather than a delete plus insert, but the semantics are the same

Re: UPDATE triggers with REPLACE statements

2011-12-19 Thread Jim McNeely
Not if you are using innoDB tables. For these, you use INSERT and UPDATE triggers. Jim McNeely On Dec 19, 2011, at 11:58 AM, Halász Sándor wrote: 2011/12/19 11:30 -0800, Jim McNeely In the MySQL documentation, we find this tantalizing statement: It is possible that in the case

Re: UPDATE triggers with REPLACE statements

2011-12-19 Thread Hal�sz S�ndor
2011/12/19 13:55 -0800, Jim McNeely Anyway, I just thought I would share. BTW I experimented, and innoDB does updates and fires off update triggers for REPLACE statements, but MyISAM does delete/inserts. Thank you. Which version? Well, then the documentation is wrong: it is indeed visible

Re: UPDATE triggers with REPLACE statements

2011-12-18 Thread Claudio Nanni
Only if you can change the application you could use INSERTON DUPLICATE KEY UPDATE instead of REPLACE. Check Peter's post here: http://kae.li/iiigi Cheers Claudio 2011/12/17 Jim McNeely j...@newcenturydata.com Here is a fun one! I have a set of tables that get populated and changed

Re: UPDATE triggers with REPLACE statements

2011-12-17 Thread Hal�sz S�ndor
2011/12/16 16:00 -0800, Jim McNeely I have a set of tables that get populated and changed a lot from lots of REPLACE statements. Now, I need an ON UPDATE trigger, but of course the trigger never gets triggered because REPLACES are all deletes and inserts. The trigger is going to populate

UPDATE triggers with REPLACE statements

2011-12-16 Thread Jim McNeely
Here is a fun one! I have a set of tables that get populated and changed a lot from lots of REPLACE statements. Now, I need an ON UPDATE trigger, but of course the trigger never gets triggered because REPLACES are all deletes and inserts. The trigger is going to populate another table

Re: UPDATE with variable

2011-11-28 Thread Johan De Meersman
- Original Message - From: Halász Sándor h...@tbbs.net mysql update address set membersince = (select membersince from address where memberid = 1258) where memberid = 1724; IIRC, subselects are allowed, except for selects that reference the table you're updating. -- Bier met

Weird UPDATE Problem

2011-10-10 Thread D. Marshall Lemcoe Jr.
Hello all. I have recently finished my migration from an older server to a newer server running RHEL 6. The MySQL version went from 5.0.77 to 5.1.52. In my application, this query used to work just fine: $paid_query = mysql_query(UPDATE $table_name SET owed = 0 WHERE s_id = $student); Where

Re: Weird UPDATE Problem

2011-10-10 Thread Brandon Phelps
/2011 09:14 AM, D. Marshall Lemcoe Jr. wrote: Hello all. I have recently finished my migration from an older server to a newer server running RHEL 6. The MySQL version went from 5.0.77 to 5.1.52. In my application, this query used to work just fine: $paid_query = mysql_query(UPDATE $table_name SET

Re: Weird UPDATE Problem

2011-10-10 Thread Hal�sz S�ndor
2011/10/10 09:19 -0400, Brandon Phelps If this column(s) is/are a character type now, then you would need to have the values in quotes. Note that because of implicit conversion if they had numberic values no error would be reported, but maybe the equality would not be exact. -- MySQL

Update table on lost connection

2011-09-28 Thread Alex Schaft
Hi, We're busy moving legacy apps from foxpro tables to mysql. User logins were tracked via a record in a table which the app then locked, preventing multiple logins for the same user code. I want to simulate this via a locked column in a mysql table, but would need the field to be cleared

Re: Update table on lost connection

2011-09-28 Thread Hank
Check out the GET_LOCK and RELEASE_LOCK virtual lock functions in MySQL. -Hank On Wed, Sep 28, 2011 at 9:15 AM, Alex Schaft al...@quicksoftware.co.za wrote: Hi, We're busy moving legacy apps from foxpro tables to mysql. User logins were tracked via a record in a table which the app then

[question]any performance tools about UPDATE

2011-09-23 Thread jiangwen jiang
Hi, Is there any performance toolds about UPDATE/INSERT querys? I want to monitor the UPDATE/INSERT performance, check out if there's any performance bottleneck, for example: slow INSERT/UPDATE more I/O where execute INSERT Regards Thanks J.W

  1   2   3   4   5   6   7   8   9   10   >