Locking tables
I understand that at some point, a sql table that has been locked by someone will automatically be unlocked, but I'm a little unclear as to the circumstances. Say at the beginning of a function I open a connection, lock a table, and then close the connection. Then, perhaps a few lines down in the code I open a connection again. Will that table that I locked in the first connection still be locked? Carl - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Locking tables
Sorry about the mutli post of this, but I got some mail daemon errors, so I'm sending again to make sure. The question is below. Carl -- Forwarded message -- Date: Fri, 12 Apr 2002 10:20:37 -0400 From: Carl Schmidt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Locking tables I understand that at some point, a sql table that has been locked by someone will automatically be unlocked, but I'm a little unclear as to the circumstances. Say at the beginning of a function I open a connection, lock a table, and then close the connection. Then, perhaps a few lines down in the code I open a connection again. Will that table that I locked in the first connection still be locked? Carl - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Design decision on generating data
Thank you for the information. Let me please clarify that i am using a web form. I tried the one solution of converting those values that are not set to null, but mysql complained: SQL: INSERT INTO Development_Event_Show(showID,venueID,description,ageCutoff,ageDelimiter,price1,price2) VALUES('201423cb79b72b5e11','41663c7c59b77da26','',21,,21,) SQL Error: You have an error in your SQL syntax near '21,)' at line 1 Notice the pair of double commas and the one comma at the end? Thats the result of setting those values to null. I thought maybe dynmically building the query would be best because that way: 1.)those values that are to be set as null, simply could be left out of the insert statement. 2.)If each timeI returned a row where values were = -1, then i would have to add extra logic in ther presentation layer to have those values not be displayed. Any thoughts? Carl On Fri, 12 Apr 2002, Christopher Thompson wrote: On Friday 12 April 2002 8:10 pm, Carl Schmidt wrote: I have a form where a user enters some numbers into text boxes. Some of the text boxes can be left blank. The business logic receives all variables to all text boxes. Should I : I'm assuming that you are using an executable file and NOT a web form. Any data you get from a web form, you must treat as suspect and perform business logic checks in another tier. 1.) Validate on the page for the presence of a value, and if not, set the corresponding value to -1 (it will never be this value). Therefore the business logic blindly inserts everything. This is reasonable. Alternatively, set the corresponding value to NULL. 2.) Do not have the variables that correspond to blank text boxes be set to -1. Have the business logic build a query based on which variables are or are not containing a value. In this case some fields for that row may be null. I'd avoid this if you can. Too much dynamicness and it will be hard to test. sql,query. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Setting a default time in mysql table def
If I set a mysql table def time to default like so: eventTime time NOT NULL DEFAULT '0'; Will it default to the current time like the TIMESTAMP does? If not, is it possible with something like CURTIME() to make this happen? Carl - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
FOREIGN KEY Constraints
From the mysql docs, it looks like you can only use foreign keys if your tables are type InnoDB. Is this correct? Carl - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Converting table types
I don't believe my web host has either InnoDB or BDB installed on their system so I ran some tests here: mysql alter table Development_EventType TYPE=INNODB; Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 That's the result I get, but when I do a table dump, the type is still showing MyISAM. 1. Is my syntax correct on this? 2. Is there a way to list table types installed in a system? I do have php installed , there, if that helps. Carl - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Converting table types
Excellent, thanks much, that solved the problem: mysql SHOW VARIABLES LIKE 'have\_%'; +---+---+ | Variable_name | Value | +---+---+ | have_bdb | NO| | have_gemini | NO| | have_innodb | NO| | have_isam | YES | | have_raid | NO| | have_ssl | NO| +---+---+ 6 rows in set (0.00 sec) mysql Looks to pretty clear like it ain't there. Carl On Sun, 7 Apr 2002, Paul DuBois wrote: At 20:23 -0400 4/7/02, Carl Schmidt wrote: I don't believe my web host has either InnoDB or BDB installed on their system so I ran some tests here: mysql alter table Development_EventType TYPE=INNODB; Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 That's the result I get, but when I do a table dump, the type is still showing MyISAM. 1. Is my syntax correct on this? Yes, but MySQL won't complain if you alter a table to a type that isn't available. 2. Is there a way to list table types installed in a system? I do have php installed , there, if that helps. SHOW VARIABLES LIKE 'have\_%' will show many of them. MyISAM doesn't show up in the list; it's always available, from MySQL 3.23 on. Carl - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Follow up question to table types
One thing did occur to me though. I was looking at the syntax for actually creating a database on the mysql server. I wanted to make sure that those table types that are installed with mysql do not have to be specified as _available_ to tables in a particular database. In other words, when a database is created from the command line, are there any options that say something like make InnoDB types available for this database or something like that? Kind of a shot in the dark, but I wanted to cover all the bases. Carl - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Index a primary key
On Sun, 7 Apr 2002 [EMAIL PROTECTED] wrote: Your message cannot be posted because it appears to be either spam or simply off topic to our filter. To bypass the filter you must include one of the following words in your message: sql,query If you just reply to this message, and include the entire text of it in the reply, your reply will go through. However, you should first review the text of the message to make sure it has something to do with MySQL. Just typing the word MySQL once will be sufficient, for example. You have written the following: If I index a primary key, is that considered overkill? In other words, I know that a primary key is _the_ unique identifier into the table already. Carl - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Index a primary key
My understanding from the mysql docs is that indexing is to be used primarily for speeding queries on often used tables. This particular table is to be queried quite a bit , but almost entirely using the priamry key. So, I assumed that making the primary key an index would speed table searches. However, it prompted me to ask the question, are primary keys already optimized for some sort of indexing and searching? So then I emailed the list. Carl On Sat, 6 Apr 2002, Paul DuBois wrote: At 18:28 -0500 4/6/02, Carl Schmidt wrote: On Sun, 7 Apr 2002 [EMAIL PROTECTED] wrote: Your message cannot be posted because it appears to be either spam or simply off topic to our filter. To bypass the filter you must include one of the following words in your message: sql,query If you just reply to this message, and include the entire text of it in the reply, your reply will go through. However, you should first review the text of the message to make sure it has something to do with MySQL. Just typing the word MySQL once will be sufficient, for example. You have written the following: If I index a primary key, is that considered overkill? In other words, I know that a primary key is _the_ unique identifier into the table already. Carl It's overkill. Out of curiousity, why are you considering doing such a thing? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php