manipulate vs analysis

2004-04-23 Thread Saurabh Data
Dear users

can someone clarify the difference between manipulate and analysis !!

Manipulate should genreally mean changing the data and analying would mean 
investigating.
So when we talk about Buffereing and Overlaying, does it come as part of 
analysis or manipulate.

Or if someone can explain the both terms with the help of any examples !!

Many Thanks

Saurabh



___

Saurabh Data
School of Computing
University of Leeds
Leeds LS2 9JT
U.K.
one who seeketh , will findeth and all door shall open - james Allen
___
_
Find a cheaper internet access deal - choose one to suit you. 
http://www.msn.co.uk/internetaccess

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Restore problem between MySQL on Win32 and MySQL on Linux?

2004-04-23 Thread g . lams
Hi All,

I performed the backup (mysqldump -u username -p db  backup.sql) of a 
database on a Win32 (4.0.15-max-debug) server in order to restore it on 
Linux server (4.0.15-9)
When I try to restore it on the linux machine (with mysql -u username -p 
db  backup.sql), there is an error saying:
ERROR 1064 at line 12748: You have an error in your SQL syntax.  Check the 
manual that corresponds to your MySQL server version for the right syntax 
to use near 'Order tinyint(4) default NULL
) TYPE=MyISAM' at line 6

I searched the mailing list but nothing seems to apply to my case.
The database has been created with the same name, cmsdb, which has no 
special characters

Any help would be appreciated

Gael

first rows of backup file:

-- MySQL dump 9.09
--
-- Host: localhostDatabase: cmsdb
-
-- Server version   4.0.15-max-debug

--
-- Table structure for table `block`
--

CREATE TABLE block (
  BlockID int(11) NOT NULL auto_increment,
  PageID int(11) default NULL,
  BlockOrder int(11) default NULL,
  StyleID int(11) default NULL,
  BlockTypeID int(11) default NULL,
  PRIMARY KEY  (BlockID)
) TYPE=MyISAM;

--
-- Dumping data for table `block`
--

INSERT INTO block VALUES (202176,8908,1,136,NULL);
INSERT INTO block VALUES (201758,8890,2,150,NULL);
INSERT INTO block VALUES (201757,8890,2,162,NULL);
INSERT INTO block VALUES (201756,8890,1,162,NULL);
INSERT INTO block VALUES (201755,8890,2,148,NULL);
INSERT INTO block VALUES (201754,8890,1,110,NULL);
INSERT INTO block VALUES (201753,8890,1,147,NULL);

and then around row 12748:

-- Table structure for table `contenttypeversion`
--

CREATE TABLE contenttypeversion (
  ContentTypeID int(11) default NULL,
  VersionID int(11) default NULL,
  Name varchar(100) default NULL,
  HTML_Label blob,
  Order tinyint(4) default NULL
) TYPE=MyISAM;

--

Re: Storing App Settiings

2004-04-23 Thread olinux
 Unfortunately there is no standard way, i use a
 directory called includes
 and within that include_top.php includes global
 stuff across pages and a
 functions.php for functions and defines.php for
 defining constants.
 parse_ini_file is ok , i have used a modified
 function to allow multiple
 lines, although i am trying to go xml. I quite like
 how xml is used within
 java as an application and deployment descriptor. If
 only PHP has
 something similar, where it defines what classes are
 used within the app ,
 security etc ..
 

Take a look at PEAR::Config
http://pear.php.net/package/Config

olinux




__
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Restore problem between MySQL on Win32 and MySQL on Linux?

2004-04-23 Thread Victoria Reznichenko
[EMAIL PROTECTED] wrote:
 
 I performed the backup (mysqldump -u username -p db  backup.sql) of a 
 database on a Win32 (4.0.15-max-debug) server in order to restore it on 
 Linux server (4.0.15-9)
 When I try to restore it on the linux machine (with mysql -u username -p 
 db  backup.sql), there is an error saying:
 ERROR 1064 at line 12748: You have an error in your SQL syntax.  Check the 
 manual that corresponds to your MySQL server version for the right syntax 
 to use near 'Order tinyint(4) default NULL
 ) TYPE=MyISAM' at line 6
 
 I searched the mailing list but nothing seems to apply to my case.
 The database has been created with the same name, cmsdb, which has no 
 special characters
 

ORDER is a reserved  word in MySQL:
http://dev.mysql.com/doc/mysql/en/Reserved_words.html

Use -Q (--quote-names) option of mysqldump.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Help restoring mysql access

2004-04-23 Thread Egor Egorov
Thursday, April 22, 2004, 9:21:35 PM, Dave Dennis wrote:

DD Is there a procedure to follow for this exactly, step by step?

Yes.

DD Its on a running production server, don't want to lose data.

Note:
If you run MySQL server with --skip-grant-tables option, MySQL will not use privilege 
tables. So everyone will have full access to the databases. When you execute FLUSH 
PRIVILEGES MySQL server will use privilege tables again.

DD On Thu, 22 Apr 2004, Egor Egorov wrote:

 Dave Dennis [EMAIL PROTECTED] wrote:
  Dear MySQL list,
 
  Managed to create a problem where:
 
  mysql  use mysql;
 
  ERROR 1044: Access denied for user: '[EMAIL PROTECTED]' to database 'mysql'
 
  Need a procedure to follow / documented steps to restore root's access
  to database mysql, version 4.0.17 .
 

 Start MySQL server with --skip-grant-tables option, then connect to the MySQL 
 server and change privileges for 'root' user. Don't forget FLUSH PRIVILEGES.




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



update if insert fails

2004-04-23 Thread Andy Ford
Hi

Is there such a statement where, if the insert fails (due to a duplicate
record) an update will happen

Thanks

Andy


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: update if insert fails

2004-04-23 Thread Richard Davey
Hello Andy,

Friday, April 23, 2004, 12:59:28 PM, you wrote:

AF Is there such a statement where, if the insert fails (due to a duplicate
AF record) an update will happen

No, but you might want to look at REPLACE INTO to simulate this
effect.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: update if insert fails

2004-04-23 Thread Victoria Reznichenko
Andy Ford [EMAIL PROTECTED] wrote:
 
 Is there such a statement where, if the insert fails (due to a duplicate
 record) an update will happen
 

Take a look at REPLACE and INSERT .. ON DUPLICATE KEY UPDATE statements:
http://dev.mysql.com/doc/mysql/en/REPLACE.html
http://dev.mysql.com/doc/mysql/en/INSERT.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: first LIMIT then ORDER

2004-04-23 Thread Bill Easton
The last suggestion is useful when you do care which entries you get,
as you can use one order for limit and another for presentation.
For example, if you'd like the LAST 10 rows, but sorted in FORWARD
order, you can use something like

(select * from HISTORY order by version desc limit 10) order by version;

And I thought I'd have to wait for subqueries...

Date: Thu, 22 Apr 2004 10:35:17 -0500
To: Keith C. Ivey [EMAIL PROTECTED], [EMAIL PROTECTED]
From: Paul DuBois [EMAIL PROTECTED]
Subject: Re: first LIMIT then ORDER

At 11:21 -0400 4/22/04, Keith C. Ivey wrote:
On 22 Apr 2004 at 12:31, Johan Hook wrote:

  Assuming you want to order your arbitrary selection you could
  do something like:
  (SELECT t.Id FROM tab t LIMIT 10)
  UNION ALL
  (SELECT t.Id FROM tab t WHERE 1  0)
  ORDER BY t.Id

You don't even need to include the dummy query.  You can do a UNION
of one result set.  This should work:

 (SELECT t.Id FROM tab t LIMIT 10)
 ORDER BY t.Id

I wrote this comment on the mysql.com site:

 It's not documented above, but you can use ORDER BY on a UNION
 that consists of only one SELECT (and thus doesn't actually
 include the word UNION). Suppose you want the last 5 entries
 in a table, but you want them in ascending order. You can use
 this query:

 ( SELECT * FROM table_name ORDER BY ranking DESC
 LIMIT 5 ) ORDER BY ranking;

 Similarly, you could select the top 10 records from a table
 ordered by one column and then sort them alphabetically by
 another column.

Now, the fact that the syntax isn't documented may mean that it will
disappear, but it's reasonable and useful.

I doubt if it will disappear.  I think this is a better suggestion
than using a temporary table.  Thanks.

-- 
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: update if insert fails

2004-04-23 Thread B. Fongo
Use REPLACE instead.  It is similar to the INSERT except that, it will
replace any old record that match - with the new one.  A replace
statement may look like this:

REPLACE INTO TestTable (TestId, User) VALUES (007,Bond);

HTH

Babs



|| -Original Message-
|| From: Andy Ford [mailto:[EMAIL PROTECTED]
|| Sent: Friday, April 23, 2004 1:59 PM
|| To: [EMAIL PROTECTED]
|| Subject: update if insert fails
|| 
|| Hi
|| 
|| Is there such a statement where, if the insert fails (due to a
duplicate
|| record) an update will happen
|| 
|| Thanks
|| 
|| Andy
|| 
|| 
|| --
|| MySQL General Mailing List
|| For list archives: http://lists.mysql.com/mysql
|| To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: My Unicode Woes - Plz Help!!!

2004-04-23 Thread Stormblade
On Thu, 22 Apr 2004 22:30:32 -0700, Dathan Vance Pattishall wrote:

 4.0.18 does not support Unicode. The JDBC driver tries to set the UNICODE
 charset but can't because this mysql version cannot store Unicode data as a

If it's not storing the unicode as a charset do you have any idea what it's
storing it as?

 charset. If you used 4.1.1, which is alpha it supports the charset and
 correlations.

Right but 4.1.1 is alpha. Not only that but I had trouble with it as it has
bugs in this area and I wasn't running the latest nightly and since this is
for a website which will be deployed it's unwise to use a version that I
won't be able to find a webhost running.

 My suggestion is this. Store the blobs on NAS as UNICODE text. mySQL is now
 used a lookups to the blob data in a particular even hashed directory
 structure on the NAS device that holds the UTF-8 or UCS data.

What is NAS? I have heard of people using Blobs to store unicode but I have
no idea how to do this.

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Stormblade (Shaolin Code Warrior)
Software Developer (15+ Years Programming exp.)

My System: http://www.anandtech.com/mysystemrig.html?rigid=1683
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: update if insert fails

2004-04-23 Thread Donny Simonton
Actually if you are using 4.1.x

INSERT INTO table (a,b,c) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE c=3;

One of the best new features, because insert is faster than an update,
update is faster than a delete, and replace is the slowest command you can
run.  These are based on my benchmarks about 6 months ago.  

This is definitely one of my favorite commands now.

Donny



 -Original Message-
 From: B. Fongo [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 23, 2004 7:23 AM
 To: 'Andy Ford'; [EMAIL PROTECTED] Mysql. Com
 Subject: RE: update if insert fails
 
 Use REPLACE instead.  It is similar to the INSERT except that, it will
 replace any old record that match - with the new one.  A replace
 statement may look like this:
 
 REPLACE INTO TestTable (TestId, User) VALUES (007,Bond);
 
 HTH
 
 Babs
 
 
 
 || -Original Message-
 || From: Andy Ford [mailto:[EMAIL PROTECTED]
 || Sent: Friday, April 23, 2004 1:59 PM
 || To: [EMAIL PROTECTED]
 || Subject: update if insert fails
 ||
 || Hi
 ||
 || Is there such a statement where, if the insert fails (due to a
 duplicate
 || record) an update will happen
 ||
 || Thanks
 ||
 || Andy
 ||
 ||
 || --
 || MySQL General Mailing List
 || For list archives: http://lists.mysql.com/mysql
 || To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]
 




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Boyd Lynn Gerber
On Thu, 22 Apr 2004, Steven Palm wrote:
   I built, tested and installed gcc-2.95.3 on my UnixWare 7.1.0 system. 
 I used your exact configure line above and it died on the 
 --with-extra-charset=comples (said unknown charset), so I took that 
 out. However, still the same error:

Sorry that should be --with-extra-charset=complex
 
 Making all in share
 UX:make: WARNING: No suffix list.
  source='sql_lex.cc' object='sql_lex.o' libtool=no \
  depfile='.deps/sql_lex.Po' tmpdepfile='.deps/sql_lex.TPo' \
  depmode=gcc /bin/ksh ../depcomp \
  gcc -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK -DMYSQL_SERVER  
 -DDEFAULT_MYSQL_HOME=\/usr/local/mysql\  
 -DDATADIR=\/usr/local/mysql/var\  
 -DSHAREDIR=\/usr/local/mysql/share/mysql\  -DHAVE_CONFIG_H -I. -I. 
 -I.. -I../innobase/include  -I./../include  -I./../regex  -I. 
 -I../include -I.  -O3 -DDBUG_OFF   -DNO_CPLUSPLUS_ALLOCA 
 -fno-implicit-templates -fno-exceptions -fno-rtti -c -o sql_lex.o `test 
 -f 'sql_lex.cc' || echo './'`sql_lex.cc
 In file included from item.h:474,
   from mysql_priv.h:311,
   from sql_lex.cc:20:
 item_sum.h: In method `Item_sum_and::Item_sum_and(Item *)':
 item_sum.h:394: integer constant out of range

 So, if this isn't an error in the gcc version itself, but something 
 else, it it possible to workaround? Any clue what the error really is? 
 :-(

I know I do get some warnings that I ignore.  I do not have my UnixWare 
7.1.0 in a machine right now.  I have some deadlines to meet till Tuesday 
of next week.  

Sorry,

--
Boyd Gerber [EMAIL PROTECTED]
ZENEZ   1042 East Fort Union #135, Midvale Utah  84047

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql as a spatial database backend

2004-04-23 Thread James S reid
Ive posted thsi query twice and got no reply - Im sure somebody must know
thw answer!!!

whast the field length limitations for insertion of a WKT string into a
geometry column?

yours, close to giving up

james


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Restore problem between MySQL on Win32 and MySQL on Linux?

2004-04-23 Thread g . lams
It works like a charme with the -Q option

Thank you

Gael

Victoria Reznichenko [EMAIL PROTECTED] wrote on 23/04/2004 
11.26.01:

 [EMAIL PROTECTED] wrote:
  
  I performed the backup (mysqldump -u username -p db  backup.sql) of a 

  database on a Win32 (4.0.15-max-debug) server in order to restore it 
on 
  Linux server (4.0.15-9)
  When I try to restore it on the linux machine (with mysql -u username 
-p 
  db  backup.sql), there is an error saying:
  ERROR 1064 at line 12748: You have an error in your SQL syntax.  Check 
the 
  manual that corresponds to your MySQL server version for the right 
syntax 
  to use near 'Order tinyint(4) default NULL
  ) TYPE=MyISAM' at line 6
  
  I searched the mailing list but nothing seems to apply to my case.
  The database has been created with the same name, cmsdb, which has no 
  special characters
  
 
 ORDER is a reserved  word in MySQL:
http://dev.mysql.com/doc/mysql/en/Reserved_words.html
 
 Use -Q (--quote-names) option of mysqldump.
 
 
 -- 
 For technical support contracts, goto 
https://order.mysql.com/?ref=ensita
 This email is sponsored by Ensita.net http://www.ensita.net/
__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
 /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
___/   www.mysql.com
 
 
 
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 


Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Boyd Lynn Gerber
On Thu, 22 Apr 2004, Steven Palm wrote:
   Just noticed that what SCO was packaging in their (formerly available) 
 Open Source Tool Kit for Unixware ( ) was 2.95.3pl1... They said it 
 was 2.95.3 with the following patches:

I always download the lastest CVS with all patches for the tree of gcc 
that I am using.  The latest patches to all version of gcc are on the CVS 
tree or branch for the version.  These are often needed to get MySQL to 
work.
 
 The OSTK version contains a few additional fixes to correct problems on 
 Open UNIX 8.0 and UnixWare 7.1.1 systems. These corrections include:
   *a fix for 64 bit integer constant folding
   *working UNIX profiling (-p)
   *ability to optionally use the tracing thread library, libthreadT.so
   *updated system header modification scripts for OU 8.0 and UDK 
 7.1.1b FS
   *providing header modification at installation time - allowing same 
   package to be installed on different OS versions
 
   The compilers have been configured:
   *to support 64 bit integer types
   *to provide the C++ runtime as an archive and a shared object
   *for thread safety
   *the C and C++ runtime is configured for POSIX threads
   *C++ source code is always compiled with _PTHREAD defined to allow 
 the Standard Template Library to be used safely by threaded programs.
   *to generate Dwarf 2 debugging information.
   *to use the GNU x86 assembler (/usr/gnu/bin/as).
   *to use the UNIX linker (/usr/ccs/bin/ld)
 
   Since this error is when ULONGLONG_MAX is being used, is this related 
 to the 64-bit integer stuff mentioned above?  If so, does anyone have a 
 copy of the required patches?  Will going to a later version of gcc 
 help, but not hurt anything else? :-)  I hear talk about the big 
 changes between 2.95 and 3.x series, has it settled down finally to 
 the point that 3.x is preferred to use?

I use gcc-3.4.0 from CVS and it does work.  Yes the above is part of the 
problem.  That is why I said you need all patches both OS and gcc.

Good Luck,

--
Boyd Gerber [EMAIL PROTECTED]
ZENEZ   1042 East Fort Union #135, Midvale Utah  84047

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: mysql as a spatial database backend

2004-04-23 Thread emierzwa
James, I replied to you back in January. I tried it with an 854kb WKT
block with out any problems. You had sent me a couple WKT samples
offline, each of which had errors in them. After I corrected them they
worked for me. If you would like to try once more, send me a file,
offline, of your table create stmt and insert sql and I'll be happy to
try it again. I am using the latest source code build of 4.1.2 from
BitKeeper on XP.

Ed

-Original Message-
From: James S reid [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 23, 2004 7:12 AM
To: [EMAIL PROTECTED]
Subject: Re: mysql as a spatial database backend


Ive posted thsi query twice and got no reply - Im sure somebody must
know
thw answer!!!

whast the field length limitations for insertion of a WKT string into a
geometry column?

yours, close to giving up

james


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Executing Pre-Written Commands

2004-04-23 Thread Chris Stevenson
Anyone out there have any experience with the book MySQL by Paul DuBois?
I'm having trouble figuring out how to save/resuse executed commands
(primarily creating tables at this point).  Perhaps I could bounce a few
questions offline if you've got used this book before or think you can
assist me regardless.
 
Thank you and have a great day!
 
Chris Stevenson
 


Re: Fulltext search over multiple tables

2004-04-23 Thread gerald_clark
I think you want a UNION, not a JOIN.
Availabilty of UNION depends on the version you are running.
Remi Mikalsen wrote:

Hello.

I have a problem I believe must have been solved lots of times before. I am doing a 
fulltext search on two tables at the same time. The problem is that it takes about 20-30 
seconds (two really small tables!  400 entries!!!).

Here is the query:

SELECT DISTINCT object.id_object FROM object , short_info, long_info 
WHERE object.owner='2' AND ((short_info.object=object.id_object AND 
MATCH (short_info.short_info) AGAINST ('any searchstring' IN BOOLEAN 
MODE)) OR (long_info.object=object.id_object AND MATCH 
(long_info.long_info) AGAINST ('any searchstring' IN BOOLEAN MODE)));

The columns long_info and short_info are both indexed with fulltext indexes.

If I divide the query in two, and execute the two fulltext boolean searches separately, 
they take about 0.1 seconds each! Is there a way to optimize the above query to improve 
performance, or is the only solution to execute two queries?

Remodeling the database is not possible in my case. The fulltext search is a small part 
of a new search engine for a database that has been on-line for over a year now.

Remi Mikalsen

E-Mail: [EMAIL PROTECTED]
URL:http://www.iMikalsen.com
 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Executing Pre-Written Commands

2004-04-23 Thread Brian Reichert
On Fri, Apr 23, 2004 at 10:47:53AM -0400, Chris Stevenson wrote:
 Anyone out there have any experience with the book MySQL by Paul DuBois?
 I'm having trouble figuring out how to save/resuse executed commands
 (primarily creating tables at this point).  Perhaps I could bounce a few
 questions offline if you've got used this book before or think you can
 assist me regardless.

It's usually as easy as 'cat sql_command.txt | mysql'.

To wit, maintain a text file of SQL commands you want executed.

I do things like:

  #--
  drop table if exists user;

  create table user
  (
user  VARCHAR(254) unique NOT NULL,
user_id   INT UNSIGNED not null PRIMARY KEY AUTO_INCREMENT,
password  VARCHAR(32) binary NOT NULL,
name  VARCHAR(254) NOT NULL,
index (user)
  );

  # initialize a 'default' user
  
  insert into user (user, password, name, email)
values ('none', '--disabled--', 'No user assigned', '');
  #-

This way, I can completely reset my user table at a whim, and even
annotate my data.

I go so far as to have separate tables in separate files, all named
something.sql.

Then, I can reset one table

  cat user.sql | mysql test

Or all of them:

  cat *.sql | mysql test

Mind you, I haven't performed the latter with foreign keys, so you
may have to take measures to assure tables are created / initialized
into the right order...

If you have a extant database, with lots of data that you're testing,
just do a mysqldump of that table (or database) into a text file,
and you can replay it as above.  There are special arguments to
mysqldump to maintain the delete/create table (and database) commands,
so read those docs.

 Thank you and have a great day!
  
 Chris Stevenson
  

-- 
Brian Reichert  [EMAIL PROTECTED]
37 Crystal Ave. #303Daytime number: (603) 434-6842
Derry NH 03038-1713 USA BSD admin/developer at large

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: first LIMIT then ORDER

2004-04-23 Thread Keith C. Ivey
On 23 Apr 2004 at 7:23, Bill Easton wrote:

 The last suggestion is useful when you do care which entries you get,
 as you can use one order for limit and another for presentation. For
 example, if you'd like the LAST 10 rows, but sorted in FORWARD order,
 you can use something like
 
 (select * from HISTORY order by version desc limit 10) order by
 version;
 
 And I thought I'd have to wait for subqueries...

One small gotcha that Anders Karlsson pointed out to me through Paul 
DuBois:  This one-query union syntax doesn't allow you to use the ALL 
keyword after UNION (since the UNION keyword isn't even there).  That 
means it will always eliminate duplicate rows (like DISTINCT).  That 
hasn't come up when I've used it, since I've never been selecting 
result sets that could contain duplicate rows, but it's something to 
keep in mind.

-- 
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



How to translate BerkeleyDB into MySQL

2004-04-23 Thread Valentine Kouznetsov
Hi,
I never use MySQL, but force to learn about it. So far
I found that MySQL can use BerkeleyDB as underlying
DB. My question is how to translate existing Berkeley
DB (which was created by other tools) into MySQL DB.
Our application has been used Berkeley DB and now we
need to move on to MySQL. Is there any easiest way to
port our exising Berkeley DB into MySQL.

Thanks,
Valentin





__
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: InnoDB Load Problem

2004-04-23 Thread Dathan Vance Pattishall
Run Show INNODB status. Look at 

--
BUFFER POOL AND MEMORY
--
Total memory allocated 1299859045; in additional pool allocated 6113152
Buffer pool size   71936
Free buffers   59
Database pages 70898
Modified db pages  57113
Pending reads 1 
Pending writes: LRU 0, flush list 0, single page 0
Pages read 379011342, created 2581822, written 233133461
58.62 reads/s, 0.12 creates/s, 61.24 writes/s
== Buffer pool hit rate 981 / 1000


 -Original Message-
 From: Emmett Bishop [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 23, 2004 8:01 AM
 To: Dathan Vance Pattishall
 Subject: RE: InnoDB Load Problem
 
 I've been keeping tabs on this thread and would just
 like to know how to tell what the buffer pool ratio
 is. What is it a ratio of? What command do I run to
 take a look at it?
 
 Thanks,
 
 Tripp
 
 --- Dathan Vance Pattishall [EMAIL PROTECTED]
 wrote:
  Look at your fsync stat and your buffer pool ratio.
  You may get better
  performance out of use O_DIRECT since it does not
  double buffer your log
  writes.
 
  Next make sure your buffer pool ratio is close to 1
  (100%), if not raise
  your bugger pool if you can. Additionally make sure
  you transaction logs are
  large like 1/2 your buffer pool. Also note if your
  doing many fast small
  queries set innodb_thread_conncurency high (cpu+
  number of disk)*2
 
 
  For the hardware portion, you might need to use
  elvtune to get better
  throughput for your hard drive or update the kernel
  to a kernel that
  supports better interaction with your hardware
  makeup.
 
  This all assumes that your queries are already
  optimized.
 
  --
  DVP
 
   -Original Message-
   From: Marvin Wright
  [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, April 20, 2004 5:13 AM
   To: Mechain Marc; Marvin Wright; Dathan Vance
  Pattishall;
   [EMAIL PROTECTED]
   Subject: RE: InnoDB Load Problem
  
   Hi,
  
   To put the unique index on like you suggest is
  fine for this table but
   this
   table is just the top level of a hierarchy.
  
   table a has 1 record
   table b has 100's of records linked to 1 table a
  record
   table c has 100's of records linked to 1 table b
  record
  
   All the records in table b and c would need to be
  updated/deleted for a
   new
   record.
   It think this would be very time consuming, and
  the clients that are
   inserting are public internet users therefore I'd
  rather not slow these
   down.
  
  
   under load iostat -x 1 gives me this
  
   avg-cpu:  %user   %nice%sys   %idle
 38.500.00   18.00   43.50
  
   Device:rrqm/s wrqm/s   r/s   w/s  rsec/s
  wsec/srkB/swkB/s
   avgrq-sz avgqu-sz   await  svctm  %util
   /dev/hda   104.00 552.00 31.00 39.00 1088.00
  4728.00   544.00  2364.00
   83.0962.20 1174.29 141.43  99.00
   /dev/hda10.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
   /dev/hda2  104.00 552.00 31.00 39.00 1088.00
  4728.00   544.00  2364.00
   83.0982.20 1174.29  75.71  53.00
   /dev/hda30.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
   /dev/hda50.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
  
   avg-cpu:  %user   %nice%sys   %idle
 44.500.00   16.50   39.00
  
   Device:rrqm/s wrqm/s   r/s   w/s  rsec/s
  wsec/srkB/swkB/s
   avgrq-sz avgqu-sz   await  svctm  %util
   /dev/hda 6.00 838.00  1.00 58.00   64.00
  7168.0032.00  3584.00
   122.58 3.30  393.22 169.49 100.00
   /dev/hda10.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
   /dev/hda26.00 838.00  1.00 58.00   64.00
  7168.0032.00  3584.00
   122.5823.30  393.22  23.73  14.00
   /dev/hda30.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
   /dev/hda50.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
  
   avg-cpu:  %user   %nice%sys   %idle
  2.000.000.00   98.00
  
   Device:rrqm/s wrqm/s   r/s   w/s  rsec/s
  wsec/srkB/swkB/s
   avgrq-sz avgqu-sz   await  svctm  %util
   /dev/hda   195.00 162.00 58.00  8.00 2080.00
  1392.00  1040.00   696.00
   52.6144.40  740.91 128.79  85.00
   /dev/hda10.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
   /dev/hda2  195.00 162.00 58.00  8.00 2080.00
  1392.00  1040.00   696.00
   52.6164.40  740.91 151.52 100.00
   /dev/hda30.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
   /dev/hda50.00   0.00  0.00  0.000.00
  0.00 0.00 0.00
   0.00 0.000.00   0.00   0.00
  
   avg-cpu:  %user   %nice%sys   %idle
  8.000.003.00   89.00
  
   Device:rrqm/s wrqm/s   r/s   w/s  rsec/s
  wsec/s  

query mysql data dictionary

2004-04-23 Thread sbv chris
Hi, I'm trying to find a way to find the primary keys in a table and find 
constraints on a table by sql.  I would like to later issue these sql 
statements through jdbc.  hows this done in mysql?

Regards,
Sunil.
_
Lose those love handles! MSN Fitness shows you two moves to slim your waist. 
http://fitness.msn.com/articles/feeds/article.aspx?dept=exercisearticle=et_pv_030104_lovehandles

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Executing Pre-Written Commands

2004-04-23 Thread Dathan Vance Pattishall
Paul book is killer, I have the 1st and second addition - but to answer your
question the mySQL client can save commands, but if your looking for
something in mySQL itself to do that it can't. To create tables you can do
something like this.

%mysql -hyourdb -uroot -pyourpass -f yourdatabase  your ddl file

The ddl file (text file) can contain any mysql SQL command including a
create table statement.


--
DVP 

 -Original Message-
 From: Chris Stevenson [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 23, 2004 6:48 AM
 To: [EMAIL PROTECTED]
 Subject: Executing Pre-Written Commands
 
 Anyone out there have any experience with the book MySQL by Paul DuBois?
 I'm having trouble figuring out how to save/resuse executed commands
 (primarily creating tables at this point).  Perhaps I could bounce a few
 questions offline if you've got used this book before or think you can
 assist me regardless.
 
 Thank you and have a great day!
 
 Chris Stevenson
 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: update if insert fails

2004-04-23 Thread Dathan Vance Pattishall
You can use replace into, but note it cannot do

Replace into table VALUES (1,2,3,col4+1);



 -Original Message-
 From: Andy Ford [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 23, 2004 3:59 AM
 To: [EMAIL PROTECTED]
 Subject: update if insert fails
 
 Hi
 
 Is there such a statement where, if the insert fails (due to a duplicate
 record) an update will happen
 
 Thanks
 
 Andy
 
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: query mysql data dictionary

2004-04-23 Thread Dathan Vance Pattishall
SHOW KEYS FROM TABLE


 -Original Message-
 From: sbv chris [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 22, 2004 7:26 AM
 To: [EMAIL PROTECTED]
 Subject: query mysql data dictionary
 
 Hi, I'm trying to find a way to find the primary keys in a table and find
 constraints on a table by sql.  I would like to later issue these sql
 statements through jdbc.  hows this done in mysql?
 
 Regards,
 Sunil.
 
 _
 Lose those love handles! MSN Fitness shows you two moves to slim your
 waist.
 http://fitness.msn.com/articles/feeds/article.aspx?dept=exercisearticle=e
 t_pv_030104_lovehandles
 
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: mySQL: Table locking problems when non-index keys used

2004-04-23 Thread Dathan Vance Pattishall
Use indexes. Make sure your indexes are on the right side of the where
clause ie.

SELECT col1,col2 from tablewithproperindexes where col3=const_index_lookup.

Or  you can use a dirty read as your transaction model to help out a TINY
bit.

--
DVP

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 22, 2004 8:09 PM
 To: [EMAIL PROTECTED]
 Subject: mySQL: Table locking problems when non-index keys used
 
 
 Friends,
 
 Sorry to post this question again.   I got a message saying that the
 server couldn't transfer this message to some groups.   Also I didn't get
 any response to this question.
 
 
 We are using mysql 4.0.17 with innodb option.  In a query, when a WHERE
 clause contains a non-indexed columns, it locks the entire table instead
 of row lock.  Is there any solution apart from building index on each
 query key ?  Is there a solution in any of the later versions  ?
 
 With Best Regards,
 Ravi
 
 
 Confidentiality Notice
 
 The information contained in this electronic message and any attachments
 to this message are intended
 for the exclusive use of the addressee(s) and may contain confidential or
 privileged information. If
 you are not the intended recipient, please notify the sender at Wipro or
 [EMAIL PROTECTED] immediately
 and destroy all copies of this message and any attachments.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Executing Pre-Written Commands

2004-04-23 Thread Michael Stassen
Brian Reichert wrote:
On Fri, Apr 23, 2004 at 10:47:53AM -0400, Chris Stevenson wrote:

Anyone out there have any experience with the book MySQL by Paul DuBois?
I'm having trouble figuring out how to save/reuse executed commands
(primarily creating tables at this point).  Perhaps I could bounce a few
questions offline if you've used this book before or think you can
assist me regardless.


It's usually as easy as 'cat sql_command.txt | mysql'.
snip
Then, I can reset one table

  cat user.sql | mysql test
That works perfectly, but I'm lazy, so I would enter

  mysql test user.sql

to save a few keystrokes.

Note that you can also execute a file of sql commands from within the mysql 
client using the source command:

  mysql source user.sql;

Or all of them:

  cat *.sql | mysql test

Mind you, I haven't performed the latter with foreign keys, so you
may have to take measures to assure tables are created / initialized
into the right order...
Right.  Order may be important, even without foreign keys.  Any script which 
depends on another must come after it.  So, if you want to execute them all 
in one go like this, you've either got to be careful how you write your 
scripts so they are truly independent, or you have to cleverly name them so 
that alphabetical ordering by filename yields the correct sequence of events.

If you have a extant database, with lots of data that you're testing,
just do a mysqldump of that table (or database) into a text file,
and you can replay it as above.  There are special arguments to
mysqldump to maintain the delete/create table (and database) commands,
so read those docs.

Thank you and have a great day!

Chris Stevenson





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Steven Palm
On Apr 23, 2004, at 8:30 AM, Boyd Lynn Gerber wrote:
I always download the lastest CVS with all patches for the tree of gcc
that I am using.  The latest patches to all version of gcc are on the 
CVS
tree or branch for the version.  These are often needed to get MySQL to
work.
 Bother...  I have all the latest patches to UnixWare 7.1.0 installed, 
and I have a fresh-from-CVS (gcc-2.95_branch) gcc installed (reports 
2.95.4 as version).

 Same error (not a warning) on sql_lex.cc: item_sum.h:394: integer 
constant out of range

 I tried to compile gcc-3_40 (release, not CVS) but it wouldn't 
compile. If I knew for sure that it would fix the problem (where 2.95.4 
did not), I would try a 3.3 series, but at this point I've spent quite 
a bit of time and haven't moved much. :-(



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: oblivious to the obvious

2004-04-23 Thread Ivan Cukic (Foment)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
| $result = mysql_query(UPDATE sunday SET
| a5_n_1='$sun_5a_n1',a5_t_1='$sun_5a_t1')
What do you expect the UPDATE command to return?

I think that you have the error here:

| while($row = mysql_fetch_array($result)) {

and here

| mysql_free_result($result);

and not in the lines you've marked, because there is no result of the
UPDATE command.
Best regards, Ivan

- --
To mess up a Linux box, you need to work at it;
to mess up your Windows box, you just need to work on it.
- - Scott Granneman, Security Focus
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAiXisTGB93IULb3YRAswrAKDdEicezEU0azJ/0jLQAp+nveMehACfV27e
9biw3qvLCcz4BS5nYAmPFE4=
=yuzU
-END PGP SIGNATURE-


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: oblivious to the obvious

2004-04-23 Thread Arthur Pelkey
thanks for the input, i guess i should stop re-using code that does't 
apply in all situations, such as update not returning a result, etc, etc 
while im tired ;), thanks!

Ivan Cukic (Foment) wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
| $result = mysql_query(UPDATE sunday SET
| a5_n_1='$sun_5a_n1',a5_t_1='$sun_5a_t1')
What do you expect the UPDATE command to return?

I think that you have the error here:

| while($row = mysql_fetch_array($result)) {

and here

| mysql_free_result($result);

and not in the lines you've marked, because there is no result of the
UPDATE command.
Best regards, Ivan

- --
To mess up a Linux box, you need to work at it;
to mess up your Windows box, you just need to work on it.
- - Scott Granneman, Security Focus
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAiXisTGB93IULb3YRAswrAKDdEicezEU0azJ/0jLQAp+nveMehACfV27e
9biw3qvLCcz4BS5nYAmPFE4=
=yuzU
-END PGP SIGNATURE-


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Patches

2004-04-23 Thread Hassan Shaikh
Where can I download patches for MySQL 4.0.17 from?

Thanks.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Patches

2004-04-23 Thread Dathan Vance Pattishall
Do you want the binary or the src code?

http://dev.mysql.com/downloads/index.html

If you want the developer repo go here.

http://dev.mysql.com/doc/mysql/en/Installing_source_tree.html


 -Original Message-
 From: Hassan Shaikh [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 23, 2004 12:24 PM
 To: [EMAIL PROTECTED]
 Subject: Patches
 
 Where can I download patches for MySQL 4.0.17 from?
 
 Thanks.
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



oblivious to the obvious

2004-04-23 Thread Arthur Pelkey
I keep getting Warning: mysql_fetch_array(): supplied argument is not a 
valid MySQL result resource in lines 17 and 21, they are marked below. I 
am drawing a blank, starting to doze off also :S, thunderbird has crappy 
default composition widths(anyone know how to change it?), so the 
formatting my be awry.

$sun_5a_n1 = 1;
$sun_5a_t1 = 2;
if($sun_5a_n1) {
	$result = mysql_query(UPDATE sunday SET 
a5_n_1='$sun_5a_n1',a5_t_1='$sun_5a_t1')
	while($row = mysql_fetch_array($result)) {
		(line 17)echo Sunday @ 5am slot modified to Name: $sun_5a_n1, Time: 
$sun_5a_t1br;
		break;
	}
	mysql_free_result($result);
(line 21)}

-Art

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: oblivious to the obvious

2004-04-23 Thread Paul DuBois
At 15:58 -0400 4/23/04, Arthur Pelkey wrote:
I keep getting Warning: mysql_fetch_array(): supplied argument is 
not a valid MySQL result resource in lines 17 and 21, they are 
marked below. I am drawing a blank, starting to doze off also :S, 
thunderbird has crappy default composition widths(anyone know how to 
change it?), so the formatting my be awry.

You don't have an error checking to test the result from mysql_query()
to make sure that it succeeded.
Adding a test on the value of $result might prove instructive.

$sun_5a_n1 = 1;
$sun_5a_t1 = 2;
if($sun_5a_n1) {
	$result = mysql_query(UPDATE sunday SET 
a5_n_1='$sun_5a_n1',a5_t_1='$sun_5a_t1')
	while($row = mysql_fetch_array($result)) {
		(line 17)echo Sunday @ 5am slot modified to Name: 
$sun_5a_n1, Time: $sun_5a_t1br;
		break;
	}
	mysql_free_result($result);
(line 21)}


--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: [PHP] oblivious to the obvious

2004-04-23 Thread Matt Matijevich
[snip]
$sun_5a_n1 = 1;
$sun_5a_t1 = 2;

if($sun_5a_n1) {
$result = mysql_query(UPDATE sunday SET 
a5_n_1='$sun_5a_n1',a5_t_1='$sun_5a_t1')
while($row = mysql_fetch_array($result)) {
(line 17)echo Sunday @ 5am slot modified to Name:
$sun_5a_n1, Time: 
$sun_5a_t1br;
break;
}
mysql_free_result($result);
(line 21)}
[/snip]

I dont think sql UPDATE will return a result resource, so you dont have
anything to fetch or free.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Compound Primary Key question

2004-04-23 Thread Emmett Bishop
Quick question. In general, is it better to create
compound primary keys or use an auto increment field
to uniquely identify each record?

--T






__
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Compound Primary Key question

2004-04-23 Thread Jeremy Zawodny
On Fri, Apr 23, 2004 at 03:40:43PM -0700, Emmett Bishop wrote:
 Quick question. In general, is it better to create
 compound primary keys or use an auto increment field
 to uniquely identify each record?

Yes.

It depends on your application and your data.

Jeremy
-- 
Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
[EMAIL PROTECTED]  |  http://jeremy.zawodny.com/

[book] High Performance MySQL -- http://highperformancemysql.com/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql using big two tables in BSD

2004-04-23 Thread kamlesh pandey
Hi Ken,
I added the index as per your suggestion ,but looks
like mysql is not using that
index(user_id,user_data2).

Here is my actual explain output for real tables.

NOTE For alert_type_list :type_id_idx is index on
alr_type,id

id_type_idx is index on id,alr_type

id_idx  is index on id

id on nfk_key_list is PRIMARY KEY

1) BEFORE CREATING index id_type_idx 

explain  select
nfk_key_list.id,nfk_key_list.nfk_string from
nfk_key_list,alert_type_list where
alert_type_list.alr_type =E/U  AND
nfk_key_list.id=alert_type_
list.id;
+-++--+--+-+-++-+
| table   | type   | possible_keys|
key  | key_len | ref | rows  
| Extra   |
+-++--+--+-+-++-+
| alert_type_list | ref| type_id_idx,id_idx   |
type_id_idx  |  50 | const   | 118271
| Using where |
| nfk_key_list| eq_ref | PRIMARY  |
PRIMARY  | 255 | alert_type_list.id  |  1
| |
+-++--+--+-+-++-+

2:AFTER CREATING id_type_idx

mysql explain select
nfk_key_list.id,nfk_key_list.nfk_string from
nfk_key_list,alert_type_list where
alert_type_list.alr_type =E/U  AND
nfk_key_list.id=alert
_type_list.id;
+-++---+--+-+-++-+
| table   | type   | possible_keys
| key  | key_len | ref
| rows   | Extra   |
+-++---+--+-+-++-+
| alert_type_list | ref|
type_id_idx,id_idx,id_type_idx| type_id_idx  |
 50 | const   | 127487 | Using where |
| nfk_key_list| eq_ref | PRIMARY  
| PRIMARY  | 255 | alert_type_list.id 
|  1 | |
+-++---+--+-+-++-+

Looks like even after creating the new index it is not
using it.
No improvement to query
It is taking about 50-55 mins to get data for about
200K matches for above query.
nfk_key_list has about 13Million and alert_type_list
has about 12 million rows.

Thanks



--- Ken Menzel [EMAIL PROTECTED] wrote:
 Hi Kamlesh,
You should send an explain of the query,  but if
 there is no index
 on tableB.user_id your join will not work well,
 since the actual join
 would be on tableB.user_id=tableA.user_id
 
 Either change your index on table b to be
 user_id,user_data2 or add
 this index.
 
 Hope this helps,
 Ken
 Ken
 - Original Message - 
 From: kamlesh pandey [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 21, 2004 5:10 PM
 Subject: mysql using big two tables in BSD
 
 
  Hi,
I'm new to mysql.
I have two big tables ,tableA4GB and
 tableB1GB.
both tables around 10 million rows,each.
 
tableA has following two cols.
 
user_id(varchar(255) PRIMARY KEY
user_data1(MEDIUMTEXT)
entries looks like
 
   user1 xyz
   user2 x1..
 
   tableB has following cols
 
   user_data2:varchar(50)
   user_id(varchar(255)).
 
  tableB is indexed on (user_data2,user_id) and on
  user_id.
  there is no primary key in tableB since,it can
 have
  entries like
  A   user1
  B   user1
  A   user2
  C   user2.
 
  I NEED to SELECT data from both tables as
 follwoing
 
  SELECT tableA.userid,tableA.user_data1 from
  tabelA,tableB where tableB.user_data2=myinput
 AND
  tableB.user_id=tableA.user_id
 
  It was good while the table size was small,but
 since
  the table size is big and growing,the query is
  becoming slow.
  I'm using  mysql_use_result().
  to get the result.
 
  Any suggestion either on client query or server
 tuning
  will
  be helpful.
 
  thanks
 
 
 
  =
  Don't worry about the world coming to an end
 today. It's already
 tomorrow in Australia.
 
  ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°
  Do You Yahoo !
  ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°
 
 
 
 
  __
  Do you Yahoo!?
  Yahoo! Photos: High-quality 4x6 digital prints for
 25¢
  http://photos.yahoo.com/ph/print_splash
 
  -- 
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:

http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 


=
Don't worry about the world coming to an end today. It's already tomorrow in 
Australia.

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°
Do You Yahoo !
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°





Is it possible to get a timestamp from the server ?

2004-04-23 Thread Greg Hosler
Hi,

I have a database application that I am porting to MySQL. one of the things
that the application needs to do is to get a timestamp from the server, so that
all instances of the application across a network can timestamp cewrtain
records using a common source for the timestamp. e.g. the sql server.

In the past, under Informix, we did the following sql:

SELECT distinct current year to second FROM systables

I've looked around, and I'm not seeing anything equivalent under MySQL. Have I
hopefully missed something ?

thx for any suggestions / hints / pointers.

best rgds,

-Greg Hosler

+-+
   You can release software that's good, software that's inexpensive, or
   software that's available on time.  You can usually release software
   that has 2 of these 3 attributes -- but not all 3.
| Greg Hosler   [EMAIL PROTECTED]|
+-+

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Is it possible to get a timestamp from the server ?

2004-04-23 Thread Brian Mansell
To get the current year, use:
SELECT DATE_FORMAT(NOW(), '%Y');

Basically you can use the DATE_FORMAT to show the present time as
desired.

--bmansell

-Original Message-
From: Greg Hosler [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 23, 2004 5:08 PM
To: [EMAIL PROTECTED]
Subject: Is it possible to get a timestamp from the server ?


Hi,

I have a database application that I am porting to MySQL. one of the
things that the application needs to do is to get a timestamp from the
server, so that all instances of the application across a network can
timestamp cewrtain records using a common source for the timestamp. e.g.
the sql server.

In the past, under Informix, we did the following sql:

SELECT distinct current year to second FROM systables

I've looked around, and I'm not seeing anything equivalent under MySQL.
Have I hopefully missed something ?

thx for any suggestions / hints / pointers.

best rgds,

-Greg Hosler

+-+
   You can release software that's good, software that's inexpensive, or
   software that's available on time.  You can usually release software
   that has 2 of these 3 attributes -- but not all 3.
| Greg Hosler   [EMAIL PROTECTED]|
+-+

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Steven Palm
On Apr 23, 2004, at 8:30 AM, Boyd Lynn Gerber wrote:
I always download the lastest CVS with all patches for the tree of gcc
that I am using.  The latest patches to all version of gcc are on the  
CVS
tree or branch for the version.  These are often needed to get MySQL to
work.
 Striking out with the 2.95branch, and not getting 3.40 to compile, I  
opted for 3.3branch.

 Looks like the same error (and more):

Making all in share
UX:make: WARNING: No suffix list.
if gcc -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK  
-DMYSQL_SERVER  -DDEFA
ULT_MYSQL_HOME=\/usr/local/mysql\   
-DDATADIR=\/usr/local/mysql/var\  -DS
HAREDIR=\/usr/local/mysql/share/mysql\  -DHAVE_CONFIG_H -I. -I.  
-I.. -I../in
nobase/include  -I./../include  -I./../regex  -I. -I../include -I.  
-I/usr/local/
include -O3 -DDBUG_OFF -I/usr/local/include  -DNO_CPLUSPLUS_ALLOCA  
-fno-impl
icit-templates -fno-exceptions -fno-rtti -DUSE_MYSYS_NEW  
-DDEFINE_CXA_PURE_VIRTU
AL -MT sql_lex.o -MD -MP -MF .deps/sql_lex.Tpo \
  -c -o sql_lex.o `test -f 'sql_lex.cc' || echo  
'./'`sql_lex.cc; \
then mv -f .deps/sql_lex.Tpo .deps/sql_lex.Po; \
else rm -f .deps/sql_lex.Tpo; exit 1; \
fi
In file included from item.h:474,
 from mysql_priv.h:311,
 from sql_lex.cc:20:
item_sum.h:394: error: integer constant is too large for long type
In file included from mysql_priv.h:312,
 from sql_lex.cc:20:
sql_class.h:169: error: non-local function `volatile pthread_mutex_t*
   MYSQL_LOG::get_log_lock()' uses anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:680: error: `
   typedef volatile struct anonymous pthread_mutex_t' does not refer  
to the
   unqualified type, so it is not used for linkage
In file included from mysql_priv.h:312,
 from sql_lex.cc:20:
sql_class.h:521: error: non-local function `const char*
   THD::enter_cond(volatile pthread_cond_t*, volatile pthread_mutex_t*,  
const
   char*)' uses anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:704: error: `
   typedef volatile struct anonymous pthread_cond_t' does not refer  
to the
   unqualified type, so it is not used for linkage
In file included from sql_class.h:625,
 from mysql_priv.h:312,
 from sql_lex.cc:20:
log_event.h:243: error: non-local function `static Log_event*
   Log_event::read_log_event(IO_CACHE*, volatile pthread_mutex_t*,  
bool)' uses
   anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:680: error: `
   typedef volatile struct anonymous pthread_mutex_t' does not refer  
to the
   unqualified type, so it is not used for linkage
log_event.h:245: error: non-local function `static int
   Log_event::read_log_event(IO_CACHE*, String*, volatile  
pthread_mutex_t*)'
   uses anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:680: error: `
   typedef volatile struct anonymous pthread_mutex_t' does not refer  
to the
   unqualified type, so it is not used for linkage
In file included from sql_lex.cc:20:
mysql_priv.h:536: error: non-local function `int mysqld_show(THD*,  
const char*,

   show_var_st*, enum_var_type, volatile pthread_mutex_t*)' uses  
anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:680: error: `
   typedef volatile struct anonymous pthread_mutex_t' does not refer  
to the
   unqualified type, so it is not used for linkage
*** Error code 1 (bu21)




The OSTK version contains a few additional fixes to correct problems  
on
Open UNIX 8.0 and UnixWare 7.1.1 systems. These corrections include:
	* 	 a fix for 64 bit integer constant folding
	* 	 working UNIX profiling (-p)
	* 	 ability to optionally use the tracing thread library,  
libthreadT.so
	* 	 updated system header modification scripts for OU 8.0 and UDK
7.1.1b FS
	* 	 providing header modification at installation time - allowing  
same
  package to be installed on different OS versions

  The compilers have been configured:
*to support 64 bit integer types
*to provide the C++ runtime as an archive and a shared object
*for thread safety
*the C and C++ runtime is configured for POSIX threads
*C++ source code is always compiled with _PTHREAD defined to allow
the Standard Template Library to be used safely by threaded programs.
*to generate Dwarf 2 debugging information.
*to use the GNU x86 assembler (/usr/gnu/bin/as).
*to use the UNIX linker (/usr/ccs/bin/ld)
  Since this error is when ULONGLONG_MAX is being used, is this  
related
to the 64-bit integer stuff mentioned above?  If so, does anyone have  
a
copy of the required patches?  Will going to a later version of gcc
help, but not hurt anything else? :-)  I hear talk about the 

Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Steven Palm
 Well, using gcc-3.3_branch and UnixWare 7.1.0, I tried the dev release  
4.1.1-alpha off the mysql site to see if I would have better luck

CC=gcc CFLAGS=-I/usr/local/include  CXX=gcc  
CXXFLAGS=-I/usr/local/include
 ./configure --prefix=/usr/local/mysql --with-innodb  
--with-berkeley-db=./bdb -
-with-openssl --with-extra-charsets=complex

 (tried with and without --thread-safe-client)

UX:make: WARNING: No suffix list.
source='sql_lex.cc' object='sql_lex.o' libtool=no \
depfile='.deps/sql_lex.Po' tmpdepfile='.deps/sql_lex.TPo' \
depmode=gcc3 /bin/ksh ../depcomp \
gcc -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK -DMYSQL_SERVER   
-DDEFAULT
_MYSQL_HOME=\/usr/local/mysql\   
-DDATADIR=\/usr/local/mysql/var\  -DSHAR
EDIR=\/usr/local/mysql/share/mysql\  -DHAVE_CONFIG_H -I. -I. -I..  
-I../bdb/b
uild_unix -I../innobase/include  -I../include -I../regex  -I.  
-I/usr/local/inclu
de -O3 -DDBUG_OFF -I/usr/local/include  -DNO_CPLUSPLUS_ALLOCA  
-fno-implicit-
templates -fno-exceptions -fno-rtti -DUSE_MYSYS_NEW  
-DDEFINE_CXA_PURE_VIRTUAL -c
 -o sql_lex.o `test -f sql_lex.cc || echo './'`sql_lex.cc
In file included from mysql_priv.h:347,
 from sql_lex.cc:20:
sql_class.h:182: error: non-local function `volatile pthread_mutex_t*
   MYSQL_LOG::get_log_lock()' uses anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:680: error: `
   typedef volatile struct anonymous pthread_mutex_t' does not refer  
to the
   unqualified type, so it is not used for linkage
In file included from mysql_priv.h:347,
 from sql_lex.cc:20:
sql_class.h:653: error: non-local function `const char*
   THD::enter_cond(volatile pthread_cond_t*, volatile pthread_mutex_t*,  
const
   char*)' uses anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:704: error: `
   typedef volatile struct anonymous pthread_cond_t' does not refer  
to the
   unqualified type, so it is not used for linkage
In file included from sql_class.h:765,
 from mysql_priv.h:347,
 from sql_lex.cc:20:
log_event.h:354: error: non-local function `static Log_event*
   Log_event::read_log_event(IO_CACHE*, volatile pthread_mutex_t*,  
bool)' uses
   anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:680: error: `
   typedef volatile struct anonymous pthread_mutex_t' does not refer  
to the
   unqualified type, so it is not used for linkage
log_event.h:356: error: non-local function `static int
   Log_event::read_log_event(IO_CACHE*, String*, volatile  
pthread_mutex_t*)'
   uses anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:680: error: `
   typedef volatile struct anonymous pthread_mutex_t' does not refer  
to the
   unqualified type, so it is not used for linkage
In file included from sql_lex.cc:20:
mysql_priv.h:609: error: non-local function `int mysqld_show(THD*,  
const char*,

   show_var_st*, enum_var_type, volatile pthread_mutex_t*)' uses  
anonymous type
/usr/local/lib/gcc-lib/i686-unknown-sysv5UnixWare7.1.0/3.3.4/include/ 
sys/types.h
:680: error: `
   typedef volatile struct anonymous pthread_mutex_t' does not refer  
to the
   unqualified type, so it is not used for linkage
*** Error code 1 (bu21)
UX:make: ERROR: fatal error.
*** Error code 1 (bu21)
UX:make: ERROR: fatal error.
*** Error code 1 (bu21)
UX:make: ERROR: fatal error.
*** Error code 1 (bu21)
UX:make: ERROR: fatal error.
*** Error code 1 (bu21)
UX:make: ERROR: fatal error.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]