Re: How to select data if not in both tables?

2006-02-12 Thread Peter Brawley
Bob, There's some discussion of it at http://dev.mysql.com/doc/refman/5.0/en/rewriting-subqueries.html. PB - Bob Gailer wrote: Michael Stassen wrote: Bob Gailer wrote: Peter Brawley wrote: Grant, >If I want to select all the products that are in the product_table, >but

Re: How to select data if not in both tables?

2006-02-12 Thread Bob Gailer
Michael Stassen wrote: Bob Gailer wrote: Peter Brawley wrote: Grant, >If I want to select all the products that are in the product_table, >but not in the sale_table, how to make the query? The product_table >has all the products, but the sale table is a subset of the prod

Re: How to select data if not in both tables?

2006-02-12 Thread Grant Giddens
Thanks, This worked exactly like I had hoped. Grant Peter Brawley <[EMAIL PROTECTED]> wrote:Grant, >If I want to select all the products that are in the product_table, >but not in the sale_table, how to make the query? The product_table >has all the products, but

Re: How to select data if not in both tables?

2006-02-11 Thread Peter Brawley
); These two queries are logically equivalent. Both work. The first will usually be faster. PB Bob Gailer wrote: Peter Brawley wrote: Grant, >If I want to select all the products that are in the product_table, >but not in the sale_table, how to make the query? The product_table >

Re: How to select data if not in both tables?

2006-02-11 Thread Michael Stassen
Bob Gailer wrote: Peter Brawley wrote: Grant, >If I want to select all the products that are in the product_table, >but not in the sale_table, how to make the query? The product_table >has all the products, but the sale table is a subset of the product_table. SELECT * FROM prod

Re: How to select data if not in both tables?

2006-02-11 Thread Bob Gailer
Peter Brawley wrote: Grant, >If I want to select all the products that are in the product_table, >but not in the sale_table, how to make the query? The product_table >has all the products, but the sale table is a subset of the product_table. SELECT * FROM product_table p

Re: How to select data if not in both tables?

2006-02-11 Thread Peter Brawley
Grant, >If I want to select all the products that are in the product_table, >but not in the sale_table, how to make the query? The product_table >has all the products, but the sale table is a subset of the product_table. SELECT * FROM product_table p LEFT JOIN sale_table s USING

How to select data if not in both tables?

2006-02-11 Thread Grant Giddens
Hi, I have 2 tables like: product_table: prod_id item_name price data data etc sale_table: prod_id sale_price If I want to select all the products that are in the product_table, but not in the sale_table, how to make the query? The product_table has all the products, but the sale table is

Two transactions cannot have the AUTO-INC lock on the same table simultaneously ... what happened if it happened

2006-02-06 Thread Ady Wicaksono
concurrency for inserts into a table containing an AUTO_INCREMENT column. Two transactions cannot have the AUTO-INC lock on the same table simultaneously. What happened if it exist?... Any idea? ---TRANSACTION 0 461360628, ACTIVE 19 sec, process no 734, OS thread id 3136353728 setting auto-inc lock

Re: (mysqldump) CREATE TABLE IF NOT EXISTS. . .

2006-01-16 Thread Michael Williams
I appreciate the suggestion, but I'm not looking to drop anything. I only want it as a safety net in the event that the table doesn't already exist. I'm doing syncing of sorts, and I want the CREATE TABLE IF NOT EXISTS so as not to throw errors in the event that the table

Re: (mysqldump) CREATE TABLE IF NOT EXISTS. . .

2006-01-16 Thread Jake Peavy
DROP TABLE IF NOT EXISTS? On 1/16/06, Michael Williams <[EMAIL PROTECTED]> wrote: > > Hi All, > > Having a bit of mysqldump trouble again. I've looked over the > documentation (again) and can't seem to find the flag to make > 'mysqldump' out pu

(mysqldump) CREATE TABLE IF NOT EXISTS. . .

2006-01-16 Thread Michael Williams
Hi All, Having a bit of mysqldump trouble again. I've looked over the documentation (again) and can't seem to find the flag to make 'mysqldump' out put "CREATE TABLE IF NOT EXISTS". Any ideas? Regards, Michael -- MySQL General Mailing List For list ar

Re: removing ibdata1 if some/all tables are not InnoDB?

2006-01-03 Thread Chander Ganesan
InnoDB does purge deleted rows from the ibdata files. Certain PostgreSQL advocates have been spreading a claim that InnoDB would not do that, but the claim is false. If your ibdata file keeps growing indefinitely, please check with SHOW INNODB STATUS that you do commit all your transactions

Re: removing ibdata1 if some/all tables are not InnoDB?

2006-01-03 Thread Remigiusz SokoĊ‚owski
Heikki Tuuri wrote: Carl, InnoDB does purge deleted rows from the ibdata files. Certain PostgreSQL advocates have been spreading a claim that InnoDB would not do that, but the claim is false. Could You explain more about reusing space previously taken by deleted rows? Is this concept simil

Re: removing ibdata1 if some/all tables are not InnoDB?

2006-01-03 Thread Heikki Tuuri
Carl, InnoDB does purge deleted rows from the ibdata files. Certain PostgreSQL advocates have been spreading a claim that InnoDB would not do that, but the claim is false. If your ibdata file keeps growing indefinitely, please check with SHOW INNODB STATUS that you do commit all your

Re: removing ibdata1 if some/all tables are not InnoDB?

2006-01-02 Thread Alex
HI Carl, The ibdata file growth can be stopped by removing the autoextend keyword in the my.cnf file. In your my.cnf file the entry might be innodb_data_file_path = ibdata1:256M:autoextend If you want to stop the growth of that file and add another file then this is what you want

Re: removing ibdata1 if some/all tables are not InnoDB?

2006-01-02 Thread Chander Ganesan
g that you would use in the my.cnf file to set things up). You'll have to find out the size in MB of your current file (ls -lh) when you do this (if you want to start a new innodb data file on a separate disk, etc.), since in my experience MySQL will complain if you specify the size of the f

removing ibdata1 if some/all tables are not InnoDB?

2006-01-02 Thread Carl Brewer
r as long as we have that InnoDB database. Am I correct? I'm no MySQL guru, my parsing of TFM and googling around and finding bug and feature requests for ibdata1 purging suggests that this is the case. If so, if I drop the InnoDB database, stop mysqld, delete (UNIX filesystem) the imdata1

RE: update or insert if necessary?

2005-12-28 Thread John Trammell
ject: update or insert if necessary? > > I have a situation where I need to update a record for a > given key in a MySQL table, but insert a record if the key > doesn't exist. I could do this by doing a SELECT on the key, > then doing an UPDATE if anything comes back, or a

Re: update or insert if necessary?

2005-12-28 Thread Jeremiah Gowdy
Actually, you may be more interested in: INSERT . ON DUPLICATE KEY UPDATE - Original Message - From: "steve" <[EMAIL PROTECTED]> To: Sent: Wednesday, December 28, 2005 6:57 AM Subject: update or insert if necessary? I have a situation where I need to update a record

Re: update or insert if necessary?

2005-12-28 Thread Jeremiah Gowdy
http://dev.mysql.com/doc/refman/5.0/en/replace.html - Original Message - From: "steve" <[EMAIL PROTECTED]> To: Sent: Wednesday, December 28, 2005 6:57 AM Subject: update or insert if necessary? I have a situation where I need to update a record for a given key in a

update or insert if necessary?

2005-12-28 Thread steve
I have a situation where I need to update a record for a given key in a MySQL table, but insert a record if the key doesn't exist. I could do this by doing a SELECT on the key, then doing an UPDATE if anything comes back, or and INSERT otherwise. This seems rather clunky though, an

RE: How can you tell if a table is corrupted?

2005-12-11 Thread Logan, David (SST - Adelaide)
- From: Subscriptions [mailto:[EMAIL PROTECTED] Sent: Monday, 12 December 2005 3:01 AM To: mysql@lists.mysql.com Subject: How can you tell if a table is corrupted? Hi all, Say, is there a way to tell if a table has been corrupted? We're having some weird things happening and the only thing

Re: How can you tell if a table is corrupted?

2005-12-11 Thread Eric Bergen
If mysql detects corruption it will stop further access to the table until you repair it. It is possible for corruption to happen where mysql can't detect it. If you suspect corruption run a repair on the table. On 12/11/05, Subscriptions <[EMAIL PROTECTED]> wrote: > Hi all, > Sa

How can you tell if a table is corrupted?

2005-12-11 Thread Subscriptions
Hi all, Say, is there a way to tell if a table has been corrupted? We're having some weird things happening and the only thing I can think of is possible corruption of a table, but is there anything you can do to find out? Jenifer

Re: how to test if strings are numeric ?

2005-12-03 Thread SGreen
'; > > Now I want to validate that the user-enterred-value is only a numeric > value... > (the major problem is where users enter special characters that leads to > exceptions / errors being thrown - like if the user enterred ' (a single > quote) that would close the

Re: how to test if strings are numeric ?

2005-12-03 Thread Michael Stassen
"C.R.Vegelin" <[EMAIL PROTECTED]> wrote: > > Hi everybody, > I looked for a function to test whether a string is numeric (having > characters 0..9 only). I found in the 5.0 manual Cast() and Convert(), but > I don't think these do what I need. Any suggestion what function to use ? > Thanks in adva

Re: how to test if strings are numeric ?

2005-12-03 Thread Anoop kumar V
here users enter special characters that leads to exceptions / errors being thrown - like if the user enterred ' (a single quote) that would close the string and the %' would be considered as an invalid character..) Thanks - Anoop On 12/3/05, Gleb Paharenko <[EMAIL PROTE

Re: how to test if strings are numeric ?

2005-12-03 Thread Gleb Paharenko
Hello. Possible solution is to use REGEXP: mysql> select '911' regexp '^[1-9]*$'; +-+ | '911' regexp '^[1-9]*$' | +-+ | 1 | +-+ mysql> select

how to test if strings are numeric ?

2005-12-03 Thread C.R.Vegelin
Hi everybody, I looked for a function to test whether a string is numeric (having characters 0..9 only). I found in the 5.0 manual Cast() and Convert(), but I don't think these do what I need. Any suggestion what function to use ? Thanks in advance, Cor

Re: How to use 'if' in select [solved]

2005-11-29 Thread Gobi
Thanks for everyone's input. Essentially, I summed up all the NEGs and non-NEGs in a view and then use the 'if' logic to filter out the numbers. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: How to use 'if' in select

2005-11-28 Thread Gobi
not what you wanted. However, what you want still isn't very clear to me but this might help you get better data for your application to make decisions from: SELECT sum(if(status1='neg',1,0)) as neg1 ,sum(if(status1='pos',1,0)) as pos1 ,sum(if(status2='neg

Re: How to use 'if' in select

2005-11-28 Thread Gobi
not what you wanted. However, what you want still isn't very clear to me but this might help you get better data for your application to make decisions from: SELECT sum(if(status1='neg',1,0)) as neg1 ,sum(if(status1='pos',1,0)) as pos1 ,sum(if(status2='neg

Re: How to use 'if' in select

2005-11-28 Thread SGreen
Gobi <[EMAIL PROTECTED]> wrote on 11/28/2005 10:34:37 AM: > Felix Geerinckx wrote: > > >On 28/11/2005, Gobi wrote: > > > > > > > >>I need to write a select clause based on the following conditions: > >> > >>If all rows of status1

Re: How to use 'if' in select

2005-11-28 Thread Gobi
Felix Geerinckx wrote: On 28/11/2005, Gobi wrote: I need to write a select clause based on the following conditions: If all rows of status1 == "Neg" count all "Neg" rows in status1 else check if all rows of status2 == "Neg" count all "Neg"

Re: How to use 'if' in select

2005-11-28 Thread Felix Geerinckx
On 28/11/2005, Gobi wrote: > I need to write a select clause based on the following conditions: > > If all rows of status1 == "Neg" > count all "Neg" rows in status1 > else > check if all rows of status2 == "Neg" > count all "Neg&quo

How to use 'if' in select

2005-11-28 Thread Gobi
I have not used an 'if' clause in select before but I think I may have a scenario which calls for it. I have a table with the following sample data: idx status1 status2 1"Neg""Neg" 2"Pos""Neg" 3"Neg"NULL 4

Re: LOAD DATA IF?

2005-11-03 Thread Scott Haneda
on 11/3/05 12:11 AM, John thegimper at [EMAIL PROTECTED] wrote: > I dont want it to INSERT that row. > > Sample.txt > name;category;price > samsung;dvd;60 > siemens;mobile;40 > none;none;0 > > Say i dont want to insert rows where category is mobile or price <= 0. > So in this case only the 'sams

Re: LOAD DATA IF?

2005-11-02 Thread John thegimper
uBois <[EMAIL PROTECTED]>: > At 1:16 +0100 11/3/05, John thegimper wrote: > >Is it possible to specify and IF statement or IGNORE statement when > >useing LOAD > >DATA? > >Example > > > >SET price = IF PRICE(< 20) THEN IGNORE > >SET price = IGNO

Re: LOAD DATA IF?

2005-11-02 Thread Paul DuBois
At 1:16 +0100 11/3/05, John thegimper wrote: Is it possible to specify and IF statement or IGNORE statement when useing LOAD DATA? Example SET price = IF PRICE(< 20) THEN IGNORE SET price = IGNORE IF <20 What is the semantics of IGNORE? What do you expect to happen? -- Paul DuBois,

LOAD DATA IF?

2005-11-02 Thread John thegimper
Is it possible to specify and IF statement or IGNORE statement when useing LOAD DATA? Example SET price = IF PRICE(< 20) THEN IGNORE SET price = IGNORE IF <20 - FREE E-MAIL IN 1 MINUTE! - [EMAIL PROTECTED] - http://www.pc.nu -- MySQL G

LASSO TIPS for MYSQL: 3.2 IF I ONLY HAD A...

2005-10-18 Thread m i l e s
to get a major upgrade. I'll be in MASSACHUSETTS the week of NOV 1st - 7th (2005). Ive got a number of clients and appointments but if anyone wants to get together for a lil chat/wrap/coding session ping me. Thirdly, Many people have asked me to write a book, I'll tell you straight up, Im not

RE: Detect if table exists from within MySQL?

2005-10-06 Thread Ryan Stille
> Maybe you could use > > SHOW TABLES LIKE 'your_table'; That's a great idea, I just tried it in several ways, like: IF EXISTS (SHOW TABLES LIKE 'cfgbiz') THEN SELECT siacnotifyto FROM cfgbiz ELSE SELECT '' as siacnotifyto END IF;

Re: Detect if table exists from within MySQL?

2005-10-06 Thread Jeff Smelser
On Thursday 06 October 2005 10:57 am, Ryan Stille wrote: > I am converting some code from MSSQL to MySQL. In one place I need to > have a conditional query depending on if a table exists or not. There > are different versions of this application and the table only exists in > some of

Re: Detect if table exists from within MySQL?

2005-10-06 Thread Keith Ivey
Ryan Stille wrote: If I have to, I could resort to doing another query in my application (SHOW TABLES) and seeing if my table was returned in that list. But I was hoping for a more elegant way to do it, within the single query. Maybe you could use SHOW TABLES LIKE 'your_table';

RE: Detect if table exists from within MySQL?

2005-10-06 Thread Ryan Stille
> If 'SHOW COLUMNS FROM tablename' returns error 1146 (42S02), the > table doesn't exist. This causes my application (ColdFusion) to throw an exception. If I have to, I could resort to doing another query in my application (SHOW TABLES) and seeing if my table was returned

Re: Detect if table exists from within MySQL?

2005-10-06 Thread Peter Brawley
Ryan, >I am converting some code from MSSQL to MySQL. In one place I need to >have a conditional query depending on if a table exists or not. There >are different versions of this application and the table only exists in >some of them. Here is how it was done in MSSQL: If '

Detect if table exists from within MySQL?

2005-10-06 Thread Ryan Stille
I am converting some code from MSSQL to MySQL. In one place I need to have a conditional query depending on if a table exists or not. There are different versions of this application and the table only exists in some of them. Here is how it was done in MSSQL: IF OBJECT_ID('cfgbiz') I

Re: add a column if not exists

2005-09-27 Thread Gleb Paharenko
Hello. You can parse the output of 'SHOW CREATE TABLE' or 'SHOW COLUMNS'. See: http://dev.mysql.com/doc/mysql/en/show-columns.html http://dev.mysql.com/doc/mysql/en/show-create-table.html Claire Lee wrote: > I want to check if a column exists in a table

Re: add a column if not exists

2005-09-26 Thread Pooly
Hi, 2005/9/26, Peter Brawley <[EMAIL PROTECTED]>: > Claire, > > >I want to check if a column exists in a table before I > >do an alter table to add it. How do I do this in > >mysql? Thanks. other solution, do your query in all case and check for the return erro

Re: add a column if not exists

2005-09-26 Thread Peter Brawley
Claire, >I want to check if a column exists in a table before I >do an alter table to add it. How do I do this in >mysql? Thanks. If you are using MySQL 5.0, query information_schema.columns (http://dev.mysql.com/doc/mysql/en/columns-table.html) for the table and column. Otherwise

add a column if not exists

2005-09-26 Thread Claire Lee
I want to check if a column exists in a table before I do an alter table to add it. How do I do this in mysql? Thanks. Claire __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- MySQL

How do I know if I am within a transaction?

2005-09-23 Thread Andrew Kuebler
If I BEGIN a transaction and a piece of PHP code containing another transaction is run, the second BEGIN commits the first transaction for me. How can I tell if I am in an existing transaction so that I do not issue the second BEGIN? Thanks.. Andrew -- MySQL General Mailing List For list

Re: MySQL Bugs: #7714: if disk full, sometimes MyISAM doesn't wait for free space, corrupts table

2005-09-21 Thread Guilhem Bichot
Hi, On Wed, Sep 21, 2005 at 02:40:26PM +0530, Jaspreet Singh wrote: > Hi, > > I was trying to impose hard disk-quotas over MySQL database when i > stumbled upon this bug. (Bug #7714) > > The Bug report says that, it has been comited in 4.0 branch. But release > notes show me that it was been fix

Re: INSERT record IF NOT EXISTS?

2005-08-17 Thread Steve Edberg
At 7:10 PM -0700 8/17/05, Daevid Vincent wrote: Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? I see this "EXISTS" but not an example of how to use it with INSERT. I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr&

Re: INSERT record IF NOT EXISTS?

2005-08-17 Thread Paul DuBois
At 19:10 -0700 8/17/05, Daevid Vincent wrote: Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? Isn't that how INSERT works already? If what you mean is that you want no error to occur, perhaps you want to use INSERT IGNORE inst

Re: INSERT record IF NOT EXISTS?

2005-08-17 Thread Jasper Bryant-Greene
Daevid Vincent wrote: Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? I see this "EXISTS" but not an example of how to use it with INSERT. I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr" which is very c

INSERT record IF NOT EXISTS?

2005-08-17 Thread Daevid Vincent
Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? I see this "EXISTS" but not an example of how to use it with INSERT. I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr" which is very close, but I want it to do

Re: How to know if a migration might have problems

2005-07-20 Thread Bastian Balthazar Bux
Nuno Pereira wrote: > Hi all, > > I have a MySQL server version "4.1.10a, for pc-linux-gnu (i686)" > installed (from official binary RPMs) and running. > > My question is if there are problems from updating the server to the > most current version of the 4.1.x ser

How to know if a migration might have problems

2005-07-20 Thread Nuno Pereira
Hi all, I have a MySQL server version "4.1.10a, for pc-linux-gnu (i686)" installed (from official binary RPMs) and running. My question is if there are problems from updating the server to the most current version of the 4.1.x series, specially things that fail to work, o

Re: COUNT (*): Fast if NO where clause. slow with WHERE clause (yes, slow even if index is used).

2005-07-12 Thread Jocelyn Fournier
Hi, What about SELECT count(*) FROM table1 - SELECT count(*) FROM table1 WHERE status = 1 ? (this query should be mush faster) Regards, Jocelyn jpow wrote: Hi everyone, I have this problem of slow "count *" when I use a where clause. 1. I have a table of ~1m rows. 2. There is a "status" c

COUNT (*): Fast if NO where clause. slow with WHERE clause (yes, slow even if index is used).

2005-07-12 Thread jpow
Hi everyone, I have this problem of slow "count *" when I use a where clause. 1. I have a table of ~1m rows. 2. There is a "status" column which can be 0 or 1. 3. Most of the rows have a status of 0, but maybe 10% of them have a status of 1. 4. I need to know how many records are status 1 / 0 for

Re: If statment in query

2005-06-06 Thread SGreen
Sebastian <[EMAIL PROTECTED]> wrote on 06/05/2005 02:23:45 AM: > I have two fields: topic | title > topic does not always have data in it, so i want to select `title` when > `topic` is null.. > i thought i could do this (does not work): > IF(title IS NULL, topic, title)

Re: If statment in query

2005-06-05 Thread Michael Stassen
Sebastian wrote: I have two fields: topic | title topic does not always have data in it, so i want to select `title` when `topic` is null.. i thought i could do this (does not work): IF(title IS NULL, topic, title) AS heading Thanks. There is nothing wrong with this, as long as it is

Re: If statment in query

2005-06-04 Thread Simon Garner
Sebastian wrote: I have two fields: topic | title topic does not always have data in it, so i want to select `title` when `topic` is null.. i thought i could do this (does not work): IF(title IS NULL, topic, title) AS heading Thanks. Try SELECT IFNULL(title, topic) AS heading -Simon

If statment in query

2005-06-04 Thread Sebastian
I have two fields: topic | title topic does not always have data in it, so i want to select `title` when `topic` is null.. i thought i could do this (does not work): IF(title IS NULL, topic, title) AS heading Thanks. -- MySQL General Mailing List For list archives: http://lists.mysql.com

Re: Even if the `published` column is 0, it still shows the title...

2005-05-24 Thread Michael Stassen
t3.`title`; What this does is to show all the titles under catid ("Category ID") that is published. 0 = not publish 1 = publish The problem is, even if the `published` column is 0, it will still show the title. I tried to do the reverse, `published`=0, and it will still show everyt

Re: Even if the `published` column is 0, it still shows the title...

2005-05-20 Thread SGreen
`='7' AND > t4.`published`=1 GROUP BY `sid` ORDER BY t3.`title`; > > What this does is to show all the titles under catid ("Category ID") that > is published. > > 0 = not publish > 1 = publish > > The problem is, even if the `published` column

Even if the `published` column is 0, it still shows the title...

2005-05-20 Thread Computer Programmer
o show all the titles under catid ("Category ID") that is published. 0 = not publish 1 = publish The problem is, even if the `published` column is 0, it will still show the title. I tried to do the reverse, `published`=0, and it will still show everything instead of just showing the unpu

Re: Default or existing value if JOIN ON clause fail?

2005-05-16 Thread Michael Stassen
anagorn wrote: I am trying to get "default" value for every ID of JOIN if ON clause were unsucessfull. In my example, I am trying to get "english" rows, but if they are not available, I would like to get default - "estonian". I have two tables ie. table1: id 1

Default or existing value if JOIN ON clause fail?

2005-05-16 Thread anagorn
I am trying to get "default" value for every ID of JOIN if ON clause were unsucessfull. In my example, I am trying to get "english" rows, but if they are not available, I would like to get default - "estonian". I have two tables ie. table1: id 1 2 3 table2

Re: if no lock at all for update

2005-05-15 Thread mfatene
Hi, What will happen is that the rdbms will lock the row for you, updates it and unlock it. This is transparent for the user. there will be a wait (not a problem) if another user want to update the same row. When the first transaction is committed, the second can hold a lock for update. There is

if no lock at all for update

2005-05-15 Thread Pengz9
Hi! If there is no any lock at all while one update a row, what it is going to happen to my SQL database? In which cases, it might cause problems? Anyone know? Thanks __ Switch to Netscape Internet Service. As low as $9.95 a

Re: Will myisam lock if the query can be resolved from disk cache/query cache?

2005-05-08 Thread Kevin Burton
Harrison Fisk wrote: There isn't really any way to "use" concurrent INSERT. It happens automatically if possible. However there are a few things you can do to help it along, such as OPTIMIZE after you DELETE large portions of the table. Also it does have to enabled in L

Re: Will myisam lock if the query can be resolved from disk cache/query cache?

2005-05-08 Thread Harrison Fisk
;t need to read the disk because the filesystem buffer has the blocks in memory. In this config will the SELECTs block for the INSERTs? I guess they would! Yes. If MySQL has to actually read the table or indexes then it will set locks to do so, as appropriate to the storage engine in use. Ke

Re: Will myisam lock if the query can be resolved from disk cache/query cache?

2005-05-08 Thread Kevin Burton
y the SELECT won't wait for any locks. So someone can have a WRITE lock on the table, and your SELECT will still run. If you have a query cache miss, then it will need to acquire the READ lock like a normal SELECT. Yes... I realize. The issue is though that only a small percentage of our q

Re: Will myisam lock if the query can be resolved from disk cache/query cache?

2005-05-08 Thread Harrison Fisk
can have a WRITE lock on the table, and your SELECT will still run. If you have a query cache miss, then it will need to acquire the READ lock like a normal SELECT. Not only THAT but it doesn't need to read the disk because the filesystem buffer has the blocks in memory. In this config will th

Will myisam lock if the query can be resolved from disk cache/query cache?

2005-05-08 Thread Kevin Burton
option of using MyISAM with no DELETEd rows (since it can then support concurrent insert.) Kevin -- Use Rojo (RSS/Atom aggregator)! - visit http://rojo.com. See irc.freenode.net #rojo if you want to chat. Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html Kevin A. Burton, Loca

Re: how to check if keys disabled?

2005-05-04 Thread Partha Dutta
> > -Original Message- > From: Jacek Becla [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 03, 2005 4:00 PM > To: Jay Blanchard > Cc: [EMAIL PROTECTED] > Subject: Re: how to check if keys disabled? > > Jay > > Are you sure? DESCRIBE tells me the table h

Re: how to check if keys disabled?

2005-05-03 Thread Jacek Becla
TECTED] Sent: Tuesday, May 03, 2005 4:00 PM To: Jay Blanchard Cc: mysql@lists.mysql.com Subject: Re: how to check if keys disabled? Jay Are you sure? DESCRIBE tells me the table has an index, but not whether the index is enabled or not: mysql> create table t1 (x int primary key); Query OK, 0 rows

RE: how to check if keys disabled?

2005-05-03 Thread Victor Pendleton
Try show index from t1; Show index from t2; -Original Message- From: Jacek Becla [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 03, 2005 4:00 PM To: Jay Blanchard Cc: mysql@lists.mysql.com Subject: Re: how to check if keys disabled? Jay Are you sure? DESCRIBE tells me the table has an

Re: how to check if keys disabled?

2005-05-03 Thread Jacek Becla
1) | NO | PRI | | | +---+-+--+-+-+---+ 1 row in set (0.00 sec) Am I missing something? thanks, Jacek Jay Blanchard wrote: [snip] How can I find out if keys are enabled/disabled for a given table? Suppose I do: create table t1 (x int primary key); create table t2 (x int primary key); alter table t1 disabl

RE: how to check if keys disabled?

2005-05-03 Thread Jay Blanchard
[snip] How can I find out if keys are enabled/disabled for a given table? Suppose I do: create table t1 (x int primary key); create table t2 (x int primary key); alter table t1 disable keys; How can I now find out that t1 has keys disabled, and t2 enabled? [/snip] DESCRIBE t1 or DESCRIBE t2

how to check if keys disabled?

2005-05-03 Thread Jacek Becla
Hi, How can I find out if keys are enabled/disabled for a given table? Suppose I do: create table t1 (x int primary key); create table t2 (x int primary key); alter table t1 disable keys; How can I now find out that t1 has keys disabled, and t2 enabled? thanks, Jacek -- MySQL General Mailing List

Re: Determining if a table exists

2005-05-03 Thread Dusan Kolesar
s like 'jst%_foo' looks like it would work just fine. Two questions: What is the column name returned and can I do an ORDER BY? If so, then I can just check the first and last rows in the results to determine the numeric range. My bad - server version is 3.23.x. Dictated by

Re: Determining if a table exists

2005-05-02 Thread Eric Bergen
the column name returned and can I do an ORDER BY? If so, then I can just check the first and last rows in the results to determine the numeric range. My bad - server version is 3.23.x. Dictated by this (old as alabama) application. They refuse to support newer versions of MySQL. - O

Re: Determining if a table exists

2005-05-02 Thread Jim McAtee
Hey, thanks. show tables like 'jst%_foo' looks like it would work just fine. Two questions: What is the column name returned and can I do an ORDER BY? If so, then I can just check the first and last rows in the results to determine the numeric range. My bad - server version

Re: Determining if a table exists

2005-05-02 Thread Eric Bergen
I don't remember what commands are available in 3.21 but try these show tables like 'table_name'; then check mysql_num_rows on the result. describe table; check mysql_num_rows show tables; then pick out the table name; 3.21 is old as alabama (forrest gump) it's time for an upgrade :) Jim McAtee wro

Determining if a table exists

2005-05-02 Thread Jim McAtee
We're running an application that creates table names in a numeric sequence. For example: jst998_foo jst998_bar jst999_foo jst999_bar jst0001000_foo jst0001000_bar jst0001001_foo jst0001001_bar I need to write a maintenance app that first needs to determine the numeric range of

Re: NEED HELP IN IF STATEMENT

2005-05-02 Thread Peter Brawley
DECLARE rowexists INT(6); select count(*) into rowexists from esr_cartitems_data where customer_id=mcustid and item_id=mprodid; if rowexists>0 THEN mvalidate := 'TRUE' else mvalidate := 'FALSE'; end if; END; Any help is welcome . Thanks, Sreedhar. ___

Re: NEED HELP IN IF STATEMENT

2005-05-02 Thread Peter Brawley
quot; := 'TRUE' " CREATE PROCEDURE cart_items_validate (IN mcustid INT ,IN mprodid varchar(10), OUT mvalidate varchar(10)) BEGIN DECLARE rowexists INT(6); select count(*) into rowexists from esr_cartitems_data where customer_id=mcustid and item_id=mprodid; if rowexists>0 THEN mva

Re: NEED HELP IN IF STATEMENT

2005-05-02 Thread SGreen
CREATE PROCEDURE cart_items_validate > (IN mcustid INT ,IN mprodid varchar(10), > OUT mvalidate varchar(10)) > > BEGIN > > DECLARE rowexists INT(6); > > > select count(*) into rowexists from esr_cartitems_data > > where customer_id=mcustid and item_id=mpr

NEED HELP IN IF STATEMENT

2005-05-02 Thread madderla sreedhar
10)) BEGIN DECLARE rowexists INT(6); select count(*) into rowexists from esr_cartitems_data where customer_id=mcustid and item_id=mprodid; if rowexists>0 THEN mvalidate := 'TRUE' else mvalidate := 'FALSE'; end if; END;

RE: using if in select statement

2005-04-29 Thread mathias fatene
#x27;mysql@lists.mysql.com ' Subject: re: using if in select statement -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 My boss and I were playing with using select statements, and we can actually execute subqueries as an option if the result is true or false. Is this expected behavior, or is it something th

re: using if in select statement

2005-04-28 Thread James Black
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 My boss and I were playing with using select statements, and we can actually execute subqueries as an option if the result is true or false. Is this expected behavior, or is it something that may be fixed in a revision, before I begin to depend on it

COUNT(DISTINCT R1,R2) within an IF statement?

2005-04-17 Thread Dan Bolser
or all FK's with the same number of R1-R2 pairs in the BLEAH group, and I do it like this... SELECT FK, COUNT(DISTINCT IF(BLEAH='Y',CONCAT(R1,"-",R2),NULL)) AS BLING GROUP BY FK HAVING BLING = 5; The problem is that CONCAT. I don't like the look of it. I

Re: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug'

2005-04-07 Thread Gleb Paharenko
Hello. If you are able to use a DBUG package on a production server - do it. You may limit debugging to the list of named functions with 'f' flag. See: http://dev.mysql.com/doc/mysql/en/the-dbug-package.html Send an output of 'SHOW VARIABLES', 'SHOW STATUS&

RE: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug'

2005-04-07 Thread Andrew Braithwaite
] Sent: Sat 02 April 2005 13:31 To: mysql@lists.mysql.com Subject: Re: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug' Hello. I don't know. With additional information we could make more ex

Re: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug'

2005-04-04 Thread Gleb Paharenko
gt;> >>>mysql-standard-4.1.10a-pc-linux-gnu-i686. I'm still getting this error >> >> >>>- does anyone have any ideas?=20 >> >> >> >>>Cheers, >> >> >> >>>Andrew >> >>

Re: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug'

2005-04-01 Thread Jocelyn Fournier
eas?=20 Cheers, Andrew -Original Message- From: Gleb Paharenko [mailto:[EMAIL PROTECTED] Sent: Thu 31 March 2005 02:31 To: mysql@lists.mysql.com Subject: Re: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-depend

<    1   2   3   4   5   6   7   8   9   10   >